Move a worksheet position

J

Jimbob

I have a macro which pastes a worksheet into a 15 sheet workbook. How can I
get the new sheet into the desired poisition (2nd to last) programmatically?

Thanks in advance
 
J

joel

with workbooks("book2.xls")
activesheet.copy _
before:=.sheets(.sheets.count)
end with
 
P

Per Jessen

Hi

Look at this:

Sheets(1).Move Before:=Sheets(Sheets.Count)
Sheets("Sheet1").Copy Before:=Sheets(Sheets.Count)

Regards,
Per
 
J

Jimbob

Terrific.
Thanks to you both.


Per Jessen said:
Hi

Look at this:

Sheets(1).Move Before:=Sheets(Sheets.Count)
Sheets("Sheet1").Copy Before:=Sheets(Sheets.Count)

Regards,
Per
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top