PDA

View Full Version : A reminder please, copying range from one ws to another



RonMcK
07-18-2008, 11:26 AM
Please remind me of the elegant one line formula for copying a range on a worksheet in a workbook and paste to a worksheet in another workbook.

Also, can I quickly retrieve the name of a worksheet if I know its number (e.g. 4 of 14 sheets)? And, if I use .names does that return all sheet names as a delimited string?

Many thanks!

Bob Phillips
07-18-2008, 11:32 AM
I think you want



Activeworkbook.Worksheets("Sheet1").Range("A1:B15").Copy _
Workbooks("ABC.xls").Worksheets("myData").Range("H5")




mySheetNameIs = Worksheets(4).Name


No, there is no Names collection, you have t build the string by iterating through all worksheets.

RonMcK
07-18-2008, 11:43 AM
Bob,

Thank you very much.:bow::bow::bow::bow::bow::bow::bow::bow::bow::yes

:ole: