ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Move a worksheet position (https://www.excelbanter.com/excel-programming/428629-move-worksheet-position.html)

Jimbob

Move a worksheet position
 
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

joel

Move a worksheet position
 
with workbooks("book2.xls")
activesheet.copy _
befo=.sheets(.sheets.count)
end with

"Jimbob" wrote:

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


Per Jessen

Move a worksheet position
 
Hi

Look at this:

Sheets(1).Move Befo=Sheets(Sheets.Count)
Sheets("Sheet1").Copy Befo=Sheets(Sheets.Count)

Regards,
Per

"Jimbob" skrev i meddelelsen
...
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



Jimbob

Move a worksheet position
 
Terrific.
Thanks to you both.


"Per Jessen" wrote:

Hi

Look at this:

Sheets(1).Move Befo=Sheets(Sheets.Count)
Sheets("Sheet1").Copy Befo=Sheets(Sheets.Count)

Regards,
Per

"Jimbob" skrev i meddelelsen
...
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





All times are GMT +1. The time now is 01:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com