VBA to rename sheet

ANE0709

Board Regular
Joined
Feb 2, 2022
Messages
65
Office Version
  1. 365
Platform
  1. Windows
Is there a way to have VBA copy a current sheet and custom rename it?

Currently we have a workbook where we create 2 new tabs for each day of the month 7.10.22 MD, 7.10.22 FE, 7.11.22 MD, 7.11.22 FE, etc. (Monday - Saturday, no Sunday dates). i would like if possible to automate this. Is this possible?

1657634927877.png
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
What is the name of this current sheet?
We can use 7.1.22 MD as a template to copy. names should be :
7.1.22 MD
7.1.22 FE
7.2.22 MD
7.2.22 FE
7.4.22 MD
7.4.22 FE
7.5.22 MD
7.5.22 FE

and continuing on for the month skipping sunday's
 
Upvote 0
This is something I'm attempting to create a script to do but it's a little complicated.
Because each month does not always have the same number of days.
So, my attempt is to have a Inputbox box popup asking you to enter the month number like 4 or 7
Like 4 for April and 7 for July

But I'm confused about what sheet we want to make a copy of you said current sheet and then said let's use 7.1.22 MD

So, what happens when you want to do this next month is it always going to be 7.1.22 MD

Are you always wanting to make a copy of the last sheet in the workbook and make 30 copies of it for a month with 30 days and 31 times when the month has 31 days, but I do realize you want 3 copies for each day? And do not want one for Sunday
 
Upvote 0
Sorry I should have said 2 sheets for each day
I said:
3 copies for each day?
 
Upvote 0
Si estuviera en tu trabajo ya te lo hubiese resuelto, en palabras no me queda muy claro. Pero yo me supongo que tu quieres colocarles nombre a tus hojas dependiendo de su fecha actual y que no sea domingo, Se puede hacer condicionales ajustando nombre concatenadas con la fecha actual y tambien se puede omitir que no sea domingo.
 
Upvote 0
This is something I'm attempting to create a script to do but it's a little complicated.
Because each month does not always have the same number of days.
So, my attempt is to have a Inputbox box popup asking you to enter the month number like 4 or 7
Like 4 for April and 7 for July

But I'm confused about what sheet we want to make a copy of you said current sheet and then said let's use 7.1.22 MD

So, what happens when you want to do this next month is it always going to be 7.1.22 MD

Are you always wanting to make a copy of the last sheet in the workbook and make 30 copies of it for a month with 30 days and 31 times when the month has 31 days, but I do realize you want 3 copies for each day? And do not want one for Sunday
i can make a template sheet if i need to. currently we are just copying and renaming.

Lets start with a sheet named TEMPLATE in which it will get copied and renamed to the dates. yes, 2 copies of each date. 7.1.22 MD and 7.1.22 FE. if removing the sunday's are too complex for the VBA then we can just leave it in we can manually delete them.
 
Upvote 0
i can make a template sheet if i need to. currently we are just copying and renaming.

Lets start with a sheet named TEMPLATE in which it will get copied and renamed to the dates. yes, 2 copies of each date. 7.1.22 MD and 7.1.22 FE. if removing the sunday's are too complex for the VBA then we can just leave it in we can manually delete them.
Yes, copying a sheet named "TEMPLATE" would be much easier.
I will get back with you
 
Upvote 0

Forum statistics

Threads
1,215,990
Messages
6,128,158
Members
449,428
Latest member
d4vew

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top