MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Adding Sheet Question, again :)


Posted by RoB on November 17, 2001 7:51 PM

Ok, i found the code to add a certain sheet which is:
Sheets.Add Type:="e:\Macros\cond_copy.xls"

and the code to move it one before the last sheet which is:
Worksheets.Add.Move before:=Worksheets(Worksheets.Count)

but how do i combine these. I want to add the specified sheet one place before the last sheet...i cant seem to combine these, can someone help?

I guess i could move it after its in, but it would be nice to do it in one line of code :)
Thanks


Posted by Ivan F Moala on November 17, 2001 8:52 PM

Sheets.Add before:=Worksheets(Worksheets.Count), Type:="e:\Macros\cond_copy.xls"