Hi
I want to append 1 more Sheet to my Workbook.
And I have trouble using :
dim MyWorkbook as Workbook
MyWorkbook.Worksheets.Add ([Before],[After],[Count],[Type]) as Object
What am I supposed to pass to [Before] or [After] ?
Thanks
Printable View
Hi
I want to append 1 more Sheet to my Workbook.
And I have trouble using :
dim MyWorkbook as Workbook
MyWorkbook.Worksheets.Add ([Before],[After],[Count],[Type]) as Object
What am I supposed to pass to [Before] or [After] ?
Thanks
these are all optional parameters. So, you can just omit them:
Set ws = ...WorkSheets.Add
Thanks for the reply.
The thing is I want to add my sheet to the end of the existing Sheets.
If I omit those optional parameters, my sheet will added infront of the
existing ones. I'm sure there 's something to do with with those [Before],[After] parameters.
OK, here is a sample from the online docs:
Worksheets("Sheet1").Move After:=Worksheets(Worksheets.Count)
Thanks, it works !
Lothar,
Can you tell me where that online docs are, I still have a
small problem with that Sheet insertion.
The first insertion and move is OK.
But right second insertion, seems like the move is executed automatically
with the old "Worksheets.count"
Thanks