ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copying sheet with macro (https://www.excelbanter.com/excel-programming/287107-copying-sheet-macro.html)

mcrmike

copying sheet with macro
 
On my worksheet (totals hours worked each day for all employes) I have
macro assigned to a button (update) on the worksheet which copies th
sheet, deletes all data and then updates the dates to the next week
The problem is, when I click the button and it copies the worksheet i
always uses the original sheet (sheet1) instead of using the ne
updated sheet (sheet2,3,ect.) when I run the macro each additiona
time. I understand that the macro is referencing sheet1, but I don'
know how to make it reference the active sheet. Help would be greatl
appreciated. Thanks

--
Message posted from http://www.ExcelForum.com


Beto[_3_]

copying sheet with macro
 
mcrmike < wrote:

On my worksheet (totals hours worked each day for all employes) I have a
macro assigned to a button (update) on the worksheet which copies the
sheet, deletes all data and then updates the dates to the next week.
The problem is, when I click the button and it copies the worksheet it
always uses the original sheet (sheet1) instead of using the new
updated sheet (sheet2,3,ect.) when I run the macro each additional
time. I understand that the macro is referencing sheet1, but I don't
know how to make it reference the active sheet. Help would be greatly
appreciated. Thanks.


Search in your code the references to sheet1 and change it for ActiveSheet.

Regards,
--
Beto
Reply: Erase between the dot (inclusive) and the @.
Responder: Borra la frase obvia y el punto previo.


mcrmike[_2_]

copying sheet with macro
 
Thanks, Beto it worked fine, things are good with the world again.


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 11:22 AM.

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