Macro to create specific Date format

ultracyclist

Active Member
Joined
Oct 6, 2010
Messages
274
Office Version
  1. 365
Platform
  1. Windows
I want to create a macro that will display the weekly date format as shown in my sample data. I need to carry this down across cell ranges in column A of my worksheet. Ex: A5:A30, A35:A86, and A93:A128. I may need to adjust the ranges but once I see the macro, I can adjust it accordingly.

Additional information- Each week ends on a Friday. For months that have 5 Friday's in them I need it to show a week 5 in those months as shown in my sample data

The data range is 7/7/2017 thru 12/31/2021

Is there a macro that can do this?

Code:
Thanks,

Allen

<style type="text/css">
.tg  {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg .tg-yw4l{vertical-align:top}
</style>
[TABLE="class: tg"]

  <tbody>[TR]

    [TH="class: tg-yw4l"]Month 2 Week 1- 8/4/2017[/TH]

  [/TR]

  [TR]

    [TD="class: tg-yw4l"]Week 2- 8/11/2017[/TD]

  [/TR]

  [TR]

    [TD="class: tg-yw4l"]Week 3- 8/18/2017[/TD]

  [/TR]

  [TR]

    [TD="class: tg-yw4l"]Week 4- 8/25/2017[/TD]

  [/TR]

  [TR]

    [TD="class: tg-yw4l"]Month 3 Week 1 -9/1/2017[/TD]

  [/TR]

  [TR]

    [TD="class: tg-yw4l"]Week 2- 9/8/2017[/TD]

  [/TR]

  [TR]

    [TD="class: tg-yw4l"]Week 3- 9/15/2017[/TD]

  [/TR]

  [TR]

    [TD="class: tg-yw4l"]Week 4- 9/22/2017[/TD]

  [/TR]

  [TR]

    [TD="class: tg-yw4l"]Week 5- 9/29/2017[/TD]

  [/TR]

</tbody>[/TABLE]
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,223,911
Messages
6,175,334
Members
452,636
Latest member
laura12345

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