PC Review


Reply
Thread Tools Rate Thread

copying data to muliple worksheets

 
 
=?Utf-8?B?SG9nb21ldGVy?=
Guest
Posts: n/a
 
      4th Nov 2006
I wish to automate the following routine:

For a list of named worksheets, say in rows a1 to a25 (the list matches the
names of the worksheets within the workbook), I want to select each item in
the list, calc, and then copy a range (d1:F50) as values to the same cells in
the associated worksheet.

Thanks!

Kevin
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      4th Nov 2006
You can test this
Replace
MsgBox SNameRng.Value

With the code you want

For example
ThisWorkbook.Worksheets(SNameRng.Value).Range("D1:F50").Copy

Sub test()
Dim SNameRng As Range
For Each SNameRng In ThisWorkbook.Sheets("Sheet1").Columns("A").SpecialCells(xlCellTypeConstants)
If SheetExists(SNameRng.Value, ThisWorkbook) = True Then

MsgBox SNameRng.value

End If
Next SNameRng
End Sub

Function SheetExists(SName As String, _
Optional ByVal WB As Workbook) As Boolean
'Chip Pearson
On Error Resume Next
If WB Is Nothing Then Set WB = ThisWorkbook
SheetExists = CBool(Len(WB.Sheets(SName).Name))
End Function



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Hogometer" <(E-Mail Removed)> wrote in message news:392FF30D-C93E-4C32-997E-(E-Mail Removed)...
>I wish to automate the following routine:
>
> For a list of named worksheets, say in rows a1 to a25 (the list matches the
> names of the worksheets within the workbook), I want to select each item in
> the list, calc, and then copy a range (d1:F50) as values to the same cells in
> the associated worksheet.
>
> Thanks!
>
> Kevin



 
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
Copying Data from several Worksheets to One drvortex Microsoft Excel Programming 2 27th Jul 2006 06:43 PM
Searching across muliple worksheets Jerry Selinger Microsoft Excel Discussion 7 25th Mar 2006 04:45 AM
Totalling Criteria from Muliple Worksheets =?Utf-8?B?T3ZlcndvcmtlZCZVbmRlcnBhaWQ=?= Microsoft Excel Misc 1 25th Aug 2005 08:14 PM
Sum Muliple Worksheets Dru Microsoft Excel Misc 2 15th Jan 2004 03:28 PM
Copying data between worksheets CMDenton Microsoft Excel Worksheet Functions 1 25th Jun 2003 07:57 PM


Features
 

Advertising
 

Newsgroups
 


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