Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying data across worksheets | Excel Discussion (Misc queries) | |||
Applying Conditional Formatting to Muliple Worksheets in Excel 200 | Excel Discussion (Misc queries) | |||
Copying Data from several Worksheets to One | Excel Programming | |||
Copying data across different worksheets | Excel Discussion (Misc queries) | |||
Totalling Criteria from Muliple Worksheets | Excel Discussion (Misc queries) |