ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Change macro to paste as last sheet (https://www.excelbanter.com/excel-discussion-misc-queries/22452-change-macro-paste-last-sheet.html)

Chance224

Change macro to paste as last sheet
 
I have a macro that copies the selected sheet and puts it before all of the
other sheets. How can I change it to put the copy after all of the other
sheets (last sheet in the workbook).

ActiveSheet.Copy Befo=Worksheets(1)

Don Guillett

after:=worksheets.count

--
Don Guillett
SalesAid Software

"Chance224" wrote in message
...
I have a macro that copies the selected sheet and puts it before all of

the
other sheets. How can I change it to put the copy after all of the other
sheets (last sheet in the workbook).

ActiveSheet.Copy Befo=Worksheets(1)




Dave Peterson

I think Don meant something more like:
ActiveSheet.Copy After:=Worksheets(worksheets.count)
or
ActiveSheet.Copy After:=Worksheets(sheets.count)



Chance224 wrote:

I have a macro that copies the selected sheet and puts it before all of the
other sheets. How can I change it to put the copy after all of the other
sheets (last sheet in the workbook).

ActiveSheet.Copy Befo=Worksheets(1)


--

Dave Peterson

Dave Peterson

Change that last one:
ActiveSheet.Copy After:=Worksheets(sheets.count)
to:
ActiveSheet.Copy After:=sheets(sheets.count)

Dave Peterson wrote:

I think Don meant something more like:
ActiveSheet.Copy After:=Worksheets(worksheets.count)
or
ActiveSheet.Copy After:=Worksheets(sheets.count)

Chance224 wrote:

I have a macro that copies the selected sheet and puts it before all of the
other sheets. How can I change it to put the copy after all of the other
sheets (last sheet in the workbook).

ActiveSheet.Copy Befo=Worksheets(1)


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 05:14 AM.

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