Consulting

Results 1 to 3 of 3

Thread: A reminder please, copying range from one ws to another

  1. #1
    VBAX Expert
    Joined
    Aug 2007
    Location
    Windermere, FL, a 'burb in the greater Orlando metro area.
    Posts
    567
    Location

    A reminder please, copying range from one ws to another

    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!
    Ron
    Windermere, FL

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I think you want

    [vba]

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

    [vba]

    mySheetNameIs = Worksheets(4).Name
    [/vba]

    No, there is no Names collection, you have t build the string by iterating through all worksheets.
    Last edited by Bob Phillips; 07-18-2008 at 11:56 AM.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Expert
    Joined
    Aug 2007
    Location
    Windermere, FL, a 'burb in the greater Orlando metro area.
    Posts
    567
    Location
    Bob,

    Thank you very much.

    Ron
    Windermere, FL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •