PDA

View Full Version : Inserting, Renaming and Moving/Sorting Worksheets



AZIQN
03-10-2009, 02:53 PM
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).


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


Thanks for your help!

Bob Phillips
03-10-2009, 02:57 PM
With ActiveWorkbook

.Worksheets.Add(after:=Worksheets(.Worksheets.Count)).Name = varDay
End With

AZIQN
03-10-2009, 03:00 PM
I knew that would be an easy one for ya xld - Thanks!