ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Moving sheets (https://www.excelbanter.com/excel-programming/323841-moving-sheets.html)

Greg[_19_]

Moving sheets
 
Hi I am copying a worksheet from a book and what I am looking to have this
automatically to the end of the workbook.

How would I do this? I have used the manual macro builder and it gives a
code like

Sheets("Sheet4").Move After:=Sheets(5)

But my workbook will have continous added sheets


Thanks in advance

Greg



JulieD

Moving sheets
 
Hi Greg

you could try something like this

dim i as long
i = sheets.count
sheets("sheet4").move after:=Sheets(i)

Cheers
JulieD

"Greg" wrote in message
...
Hi I am copying a worksheet from a book and what I am looking to have this
automatically to the end of the workbook.

How would I do this? I have used the manual macro builder and it gives a
code like

Sheets("Sheet4").Move After:=Sheets(5)

But my workbook will have continous added sheets


Thanks in advance

Greg




Greg[_19_]

Moving sheets
 
Thanks Julie

Once I worked out how to put into my code. It works perfect

Greg



JulieD

Moving sheets
 
thanks for the feedback

"Greg" wrote in message
...
Thanks Julie

Once I worked out how to put into my code. It works perfect

Greg




Greg[_19_]

Moving sheets
 
I think it did Julie it has not shown up

Thanks again

Greg




All times are GMT +1. The time now is 02:06 PM.

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