Macro, select the active sheet.
Solved
Dobynette
-
Dobynette -
Dobynette -
Hello everyone
I have been trying for several days to adapt a macro for my file, but I can't find the solution.
I created a planning file with several tabs for each month, and then tabs summarizing the presence of each person at each position for tracking purposes.
On each month tab, I have a table with the number of days of presence for each position by person, and a button with a macro that allows me to add these columns to the summary table by position.
What I am looking to do is to have a single macro regardless of the month tab from which I run it. But currently, I haven't found anything that works to replace the "Sheets("January").Select" in my macro.
Does anyone have a solution to designate the sheet from which the macro launch button was clicked?
Thanks in advance :)
I have been trying for several days to adapt a macro for my file, but I can't find the solution.
I created a planning file with several tabs for each month, and then tabs summarizing the presence of each person at each position for tracking purposes.
On each month tab, I have a table with the number of days of presence for each position by person, and a button with a macro that allows me to add these columns to the summary table by position.
What I am looking to do is to have a single macro regardless of the month tab from which I run it. But currently, I haven't found anything that works to replace the "Sheets("January").Select" in my macro.
Does anyone have a solution to designate the sheet from which the macro launch button was clicked?
Thanks in advance :)
Thank you for your reply
I had tried this command but the macro did absolutely nothing.
Here is the macro. Maybe something is missing.
This code repeats identically for 4 copy/paste in different tabs.
See if you can start your macro with:
ActiveSheet.Select
Range("B50:B67").Select
Selection.Copy
Then select the URG sheet and delete below the lines that refer to the January copy?
It seems to me that the actions you are taking before copying January can be done afterwards, right?
Otherwise, you'll have to wait for someone better at VBA, and that's probably not rare here :-))
Sincerely
I had set up the macro this way because I couldn't insert the cells while keeping the formatting all at once, but now I've succeeded and it works well! However, I'm missing a line that allows me to return to the original sheet after the first copy/paste, still without designating it by its name. I'll try to find this new solution :) Thank you!!