Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default copying data to muliple worksheets

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default copying data to muliple worksheets

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").Special Cells(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" wrote in message ...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying data across worksheets Maki Excel Discussion (Misc queries) 2 September 15th 08 02:40 PM
Applying Conditional Formatting to Muliple Worksheets in Excel 200 David Excel Discussion (Misc queries) 0 September 16th 07 11:10 PM
Copying Data from several Worksheets to One drvortex[_2_] Excel Programming 2 July 27th 06 06:43 PM
Copying data across different worksheets Nic M Excel Discussion (Misc queries) 4 May 8th 06 09:30 PM
Totalling Criteria from Muliple Worksheets Overworked&Underpaid Excel Discussion (Misc queries) 1 August 25th 05 08:14 PM


All times are GMT +1. The time now is 09:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"