Uppercase Date While Keeping DATE Format

meantis

New Member
Joined
Feb 25, 2020
Messages
2
Office Version
  1. 2019
Platform
  1. MacOS
I've been attempting to format a cell while maintaining the DATE() format:

MONTHNAME DD, YYYY

using the following code:

VBA Code:
Sub uppercase()
    With Sheets("Sheet1").Range("B2")
        .Value = Date
        .NumberFormat = UCase(Format(Date, "mmmm ")) & UCase(Format(Date, "dd")) & ", yyyy"
    End With
End Sub

What do we need to get the correct output?

Thanks for any help and direction.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
VBA Code:
Sub uppercase()
    Sheets("Sheet1").Range("B2").value = ucase(format(date,"mmmm dd, yyyy"))
End Sub
 
Upvote 0
AFAIK you cannot format the the cell to show upper case month name.
You can convert the date to text & do it that way, but you would not be able to use the date in any form of calculation
 
Upvote 0
Perhaps you're correct, @Fluff. @Ardus Petus solution makes sense and doesn't generate any runtime errors. Though the desired result isn't achieved. ?‍♂️
 
Upvote 0
If your happy with text values, how about
VBA Code:
   With Sheets("Sheet1").Range("B2")
      .Value = Date
      .NumberFormat = "@"
      .Value = UCase(Format(.Value, "mmmm dd, yyyy"))
   End With
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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