Help Getting Date on Tab

tandkb

Board Regular
Joined
Dec 29, 2010
Messages
51
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a macro that puts data that is in a cell on the tab. Currently I turn the date into Week XX and currently names the tab of the current sheet Week XX. I know you can not put / on the tab. Is there anyway I can Create Week 45 11.3.19 on the tab? I need to replace the / in the date above with . in the cell that would go on the tab.

11/3/2019
Week 45 11.3.19

Is there anyway to automate the 11.3.19 to represent whatever the date is in the cell above it?

Thanks in advance for all your help!

Thomas Bass
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
How about
Code:
    ActiveSheet.Name = "Week " & DatePart("ww", Range("A1")) & " " & Format(Range("A1"), "m.d.yy")
 
Upvote 0
That worked great except the week number is off one. This is how I normally find the week number.

=WEEKNUM(A3,21)) how would I correct it in your code?

Thanks so much!
 
Upvote 0
Try
Code:
DatePart("ww", Range("A1")[COLOR=#ff0000], vbMonday[/COLOR])
 
Upvote 0
Perfect! Thanks so much!! I really appreciate it!
 
Upvote 0
My pleasure & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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