Rename tabs from dailog box with dates

JoCook

New Member
Joined
Oct 9, 2015
Messages
14
I am trying to create a macro that will rename all tabs that have been named with a date mm-dd-yyyy. I would like a dialog box to pop up and ask for a starting date and then have the macro find the tab names with the lowest date and then rename them to the next years dates
For example current tabs are called 12-29-14, 1-05-2015, 1-12-2015…12-21-15
After running the macro I would like to type 12-28-15 into the dialog box and have the tabs read 12-28-2015, 1-04-2016, 1-11-2016… 12-26-2016.
Is this posable?
I have seen similar things on this form but haven’t been able to get them to work on my sheet
Your guy’s expertise would be greatly appreciated
 

Excel 2012
ABC
1** SheetName **
2PreviouslyNew Names
312/29/1412/28/14
41/5/151/4/15
51/12/151/11/15
612/21/1512/20/15<< Why 12/26/15 ??
Sheet1
 
Upvote 0
Im sorry the 12-26-16 should be 12-19-16. The sheets are based off the pay week starting every monday and ending on sunday. If the week is ending in the next year the week should not be acounted for in the current year spreadsheet. The last week will then be acounted for in the spreadsheet created next year.
im wanting the year to change so the New Names would be
ABC

<thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]** SheetName **[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]2[/TD]
[TD="align: center"]Previously[/TD]
[TD="align: center"]New Names[/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]
[TD="align: center"]12/29/14[/TD]
[TD="align: right"]12/28/15[/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]
[TD="align: center"]1/5/15[/TD]
[TD="align: right"]1/4/16[/TD]
[TD="align: right"][/TD]

[TD="align: center"]5[/TD]
[TD="align: center"]1/12/15[/TD]
[TD="align: right"]1/11/16[/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]
[TD="align: center"]12/21/15[/TD]
[TD="align: right"]12/26/16[/TD]

</tbody>
 
Upvote 0
I've got to run out for an hour. I'll take a further look at your needs when I get back...
 
Upvote 0
On a BACK-UP copy of your file.......
Place the below code in a Standard Module and then run

Code:
Sub RecreateYearsTimeSheets()
'*** Assumes your workbook ALREADY has only your 52 date-named sheets  ***
Dim w As Integer
Dim fWeek As Date
Dim mYweek As String
Worksheets(1).Select
w = 1
fWeek = Format(Application.InputBox("Enter the Monday Date of your First Tab"), "mm/dd/yy")
For w = 0 To 51    'Loop to run 52 times
mYweek = fWeek + (w * 7)
mYweek = Replace(mYweek, "/", "-")
Worksheets(w + 1).Name = mYweek
Next w
End Sub
 
Upvote 0
that works great! than you! i do have a question however regarding your assumption. I do have a few sheets that are summerys and the like is there a way I can prevent them form getting changed?
 
Upvote 0
Move the position of the few sheets to before the weekly sheets, then change the 0 to 51. To. 2 to 53; you can remove the code line w=1 also..
 
Upvote 0

Forum statistics

Threads
1,226,824
Messages
6,193,164
Members
453,778
Latest member
RDJones45

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