PC Review


Reply
Thread Tools Rate Thread

Copy data to multiple specific worksheets?

 
 
=?Utf-8?B?SG9nb21ldGVy?=
Guest
Posts: n/a
 
      7th Nov 2006
I wish to automatically copy a range of cells from one worksheet to several
other worksheets for which their names are contained in a range. For example:

IN the Active Worksheet:
Range a1:a5 contains a list of established worksheet names as follows (note:
there are other worksheets that are not in this list):
Facility 1
Facility 2
Facility 3
Facility 4
Facility 5

Range b10:d50 contains the cells I wish to copy to worksheet named in the
above range.

So, is there a simple macro that can copy b10:d50 in the specified
worksheets that are indicated in a1:a5 ?

Thank you!
 
Reply With Quote
 
 
 
 
PY & Associates
Guest
Posts: n/a
 
      8th Nov 2006
Adjust to suit, no checking of sheet tags


Dim srcws As Worksheet

Dim desws As Worksheet

Dim copyrng As Range

Set srcws = ActiveSheet

Set copyrng = srcws.Range("B1020")

For i = 1 To 5

n$ = Cells(i, 1)

copyrng.Copy Sheets(n).Range("B10")

Next i

"Hogometer" <(E-Mail Removed)> wrote in message
news:0BBA4809-34BC-4A4F-A814-(E-Mail Removed)...
> I wish to automatically copy a range of cells from one worksheet to

several
> other worksheets for which their names are contained in a range. For

example:
>
> IN the Active Worksheet:
> Range a1:a5 contains a list of established worksheet names as follows

(note:
> there are other worksheets that are not in this list):
> Facility 1
> Facility 2
> Facility 3
> Facility 4
> Facility 5
>
> Range b10:d50 contains the cells I wish to copy to worksheet named in the
> above range.
>
> So, is there a simple macro that can copy b10:d50 in the specified
> worksheets that are indicated in a1:a5 ?
>
> Thank you!



 
Reply With Quote
 
=?Utf-8?B?SG9nb21ldGVy?=
Guest
Posts: n/a
 
      8th Nov 2006
Thank you for your response! When I used your suggestion as programmed here,
I get an error - "subscript out of range" for line "copyrng.Copy
Sheets(n).Range("B10").

Here is the exact code I used:

Sub Macro1()

Dim desws As Worksheet
Dim copyrng As Range
Set srcws = ActiveSheet
Set copyrng = srcws.Range("B1020")
For i = 1 To 5
n$ = Cells(i, 1)
copyrng.Copy Sheets(n).Range("B10")
Next i

End Sub


Is there an obvious problem here?

Thanks again!

"Hogometer" wrote:

> I wish to automatically copy a range of cells from one worksheet to several
> other worksheets for which their names are contained in a range. For example:
>
> IN the Active Worksheet:
> Range a1:a5 contains a list of established worksheet names as follows (note:
> there are other worksheets that are not in this list):
> Facility 1
> Facility 2
> Facility 3
> Facility 4
> Facility 5
>
> Range b10:d50 contains the cells I wish to copy to worksheet named in the
> above range.
>
> So, is there a simple macro that can copy b10:d50 in the specified
> worksheets that are indicated in a1:a5 ?
>
> Thank you!

 
Reply With Quote
 
PY & Associates
Guest
Posts: n/a
 
      9th Nov 2006
Do you have anything in A1 to A5 please?

"Hogometer" <(E-Mail Removed)> wrote in message
news:ACB70D96-E5AA-4E38-891E-(E-Mail Removed)...
> Thank you for your response! When I used your suggestion as programmed

here,
> I get an error - "subscript out of range" for line "copyrng.Copy
> Sheets(n).Range("B10").
>
> Here is the exact code I used:
>
> Sub Macro1()
>
> Dim desws As Worksheet
> Dim copyrng As Range
> Set srcws = ActiveSheet
> Set copyrng = srcws.Range("B1020")
> For i = 1 To 5
> n$ = Cells(i, 1)
> copyrng.Copy Sheets(n).Range("B10")
> Next i
>
> End Sub
>
>
> Is there an obvious problem here?
>
> Thanks again!
>
> "Hogometer" wrote:
>
> > I wish to automatically copy a range of cells from one worksheet to

several
> > other worksheets for which their names are contained in a range. For

example:
> >
> > IN the Active Worksheet:
> > Range a1:a5 contains a list of established worksheet names as follows

(note:
> > there are other worksheets that are not in this list):
> > Facility 1
> > Facility 2
> > Facility 3
> > Facility 4
> > Facility 5
> >
> > Range b10:d50 contains the cells I wish to copy to worksheet named in

the
> > above range.
> >
> > So, is there a simple macro that can copy b10:d50 in the specified
> > worksheets that are indicated in a1:a5 ?
> >
> > Thank you!



 
Reply With Quote
 
PY & Associates
Guest
Posts: n/a
 
      9th Nov 2006
Your messages are falling off our screen.
Can you send messages to us direct please?

"PY & Associates" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Do you have anything in A1 to A5 please?
>
> "Hogometer" <(E-Mail Removed)> wrote in message
> news:ACB70D96-E5AA-4E38-891E-(E-Mail Removed)...
> > Thank you for your response! When I used your suggestion as programmed

> here,
> > I get an error - "subscript out of range" for line "copyrng.Copy
> > Sheets(n).Range("B10").
> >
> > Here is the exact code I used:
> >
> > Sub Macro1()
> >
> > Dim desws As Worksheet
> > Dim copyrng As Range
> > Set srcws = ActiveSheet
> > Set copyrng = srcws.Range("B1020")
> > For i = 1 To 5
> > n$ = Cells(i, 1)
> > copyrng.Copy Sheets(n).Range("B10")
> > Next i
> >
> > End Sub
> >
> >
> > Is there an obvious problem here?
> >
> > Thanks again!
> >
> > "Hogometer" wrote:
> >
> > > I wish to automatically copy a range of cells from one worksheet to

> several
> > > other worksheets for which their names are contained in a range. For

> example:
> > >
> > > IN the Active Worksheet:
> > > Range a1:a5 contains a list of established worksheet names as follows

> (note:
> > > there are other worksheets that are not in this list):
> > > Facility 1
> > > Facility 2
> > > Facility 3
> > > Facility 4
> > > Facility 5
> > >
> > > Range b10:d50 contains the cells I wish to copy to worksheet named in

> the
> > > above range.
> > >
> > > So, is there a simple macro that can copy b10:d50 in the specified
> > > worksheets that are indicated in a1:a5 ?
> > >
> > > Thank you!

>
>



 
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
macro that extracts specific data from multiple worksheets ruudboy Microsoft Excel Programming 0 28th Apr 2011 07:41 PM
Macro to pull in specific data into multiple worksheets in a workb murkaboris Microsoft Excel Misc 0 14th Apr 2009 06:25 PM
add new data to specific columns in multiple worksheets =?Utf-8?B?anVsaWVieXRoZXNlYQ==?= Microsoft Excel New Users 2 10th Jul 2007 01:24 AM
Copy data from multiple worksheets to worksheets in a number of other spreadsheets SteveH Microsoft Excel Discussion 5 6th Nov 2006 06:59 PM
How do I retrieve data (specific cells) from multiple worksheets on a shared drive jbean Microsoft Excel Worksheet Functions 1 10th Nov 2004 09:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:06 AM.