PC Review


Reply
Thread Tools Rate Thread

copy paste different ranges

 
 
Khalil Handal
Guest
Posts: n/a
 
      16th Aug 2007
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.


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      16th Aug 2007
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



Khalil Handal wrote:
>
> 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
 
Reply With Quote
 
Khalil Handal
Guest
Posts: n/a
 
      16th Aug 2007
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



"Dave Peterson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>
> Khalil Handal wrote:
>>
>> 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



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      16th Aug 2007
Nope. I don't have a password breaker.

Khalil Handal wrote:
>
> 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
>
> "Dave Peterson" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >
> >
> > Khalil Handal wrote:
> >>
> >> 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


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I copy big ranges of cells without drag or copy/paste? Ricardo Julio Microsoft Excel Misc 3 23rd Mar 2010 02:38 PM
Copy/Paste dynamic ranges kevin Microsoft Excel Programming 1 28th May 2009 07:14 PM
copy then paste to multiple ranges MJKelly Microsoft Excel Programming 3 15th Oct 2008 01:40 PM
Copy & paste ranges from 1 wkbk to another Diddy Microsoft Excel Programming 1 2nd Sep 2008 07:35 PM
Copy and paste Named Ranges Robert H Microsoft Excel Programming 6 6th Feb 2007 04:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:35 AM.