Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / August 2007

Tip: Looking for answers? Try searching our database.

copy paste different ranges

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Khalil Handal - 16 Aug 2007 11:50 GMT
Hi
I have the 20 following ranges that has formulas and I need to copy them to
another work book at the same location.
The ranges are:
H9:H12
H44:H47
H84:H87
H124:H127
H164:H167
H204:H207
H244:H247
H284:H287
H324:H327
H364:H367
H404:H407
H444:H447
H484:H487
H524:H527
H564:H567
H604:H607
H644:H647
H684:H687
H724:H727
H764:H767

I have selected theses ranges and used copy and paste special (with formula
only) but it copy them in the new work book one after the other starting at
H9 until the last cell in H88

Is there a way to solve this (VBA Code, Macro!!!) or I have to do it each
range seperatly?
Note: these formulas has to be copy to 25 diferent books.
Dave Peterson - 16 Aug 2007 12:47 GMT
After the first range H9:H12, the rest are laid out nicely.

This may work for you:

Option Explicit
Sub testme()

   Dim FromWks As Worksheet
   Dim ToWks As Worksheet
   Dim iRow As Long
   
   Set FromWks = Workbooks("book1.xls").Worksheets("Sheet1")
   Set ToWks = Workbooks("book2.xls").Worksheets("sheet1")    
   
   FromWks.Range("H9:H12").Copy
   ToWks.Range("H9").PasteSpecial Paste:=xlPasteFormulas
   
   For iRow = 44 To 764 Step 40
       FromWks.Cells(iRow, "H").Resize(4, 1).Copy
       ToWks.Cells(iRow, "H").PasteSpecial Paste:=xlPasteFormulas
   Next iRow
   
End Sub

> Hi
> I have the 20 following ranges that has formulas and I need to copy them to
[quoted text clipped - 28 lines]
> range seperatly?
> Note: these formulas has to be copy to 25 diferent books.

Signature

Dave Peterson

Khalil Handal - 16 Aug 2007 17:05 GMT
Hi Dave,
I beleive in organaized work since it makes it easy when having problems.
It worked fine with me But I forgot the password for the VBA code so I had
to open a new workbook to use the code.
Do you have a way to get the password. I may eamil the file for you.
Tell me on my email address of   khhandal AT yahoo.com

Thanks again

> After the first range H9:H12, the rest are laid out nicely.
>
[quoted text clipped - 55 lines]
>> range seperatly?
>> Note: these formulas has to be copy to 25 diferent books.
Dave Peterson - 16 Aug 2007 18:07 GMT
Nope.  I don't have a password breaker.

> Hi Dave,
> I beleive in organaized work since it makes it easy when having problems.
[quoted text clipped - 68 lines]
> >
> > Dave Peterson

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.