copying sheet with macro

M

mcrmike

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
 
B

Beto

mcrmike said:
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,
 

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