Consulting

Results 1 to 3 of 3

Thread: Inserting, Renaming and Moving/Sorting Worksheets

  1. #1
    VBAX Regular
    Joined
    Feb 2009
    Posts
    29
    Location

    Inserting, Renaming and Moving/Sorting Worksheets

    Hello, I am trying to insert a sheet into workbook "A" each day the macro is performed. I would like to rename the newly inserted sheet in wkbk "A" with the day number value stored in Range("B1") of another workbook: wkbk "B". (If it helps, I also have the day number value stored in "varDay").

    Then, I would like to move the new sheet to the end of the list of sheets at the bottom. Or, somehow sort the worksheets in order of the day (1-31).

    [VBA]
    ActiveWorkbook.Sheets.Add
    ActiveSheet.Name = varDay
    ActiveSheet.move After: '[end] or how do I complete this?
    [/VBA]

    Thanks for your help!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    With ActiveWorkbook

    .Worksheets.Add(after:=Worksheets(.Worksheets.Count)).Name = varDay
    End With
    [/vba]
    ____________________________________________
    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 Regular
    Joined
    Feb 2009
    Posts
    29
    Location
    I knew that would be an easy one for ya xld - Thanks!

Posting Permissions

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