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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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
My pleasure & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,739
Messages
6,180,674
Members
452,993
Latest member
FDARYABEE

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