Enter WEDNESDAY, not Wednesday

A

achidsey

Excel Experts,

My code enters in A2 the date and day of the week for the last trade date
(business date) in the format:
10/19/05 Wednesday

However, I'd like the day of the week to be all Caps, so that the code enters:
10/19/05 WEDNESDAY

How would I change the code below to enter the day of the week in all caps.

Thanks in advance, Alan


Sub NewDate()
Dim sDate As String
Dim sDay As String

'Updates date field with last trading day

sDate = Evaluate("=TODAY()-IF(WEEKDAY(TODAY())=2,3,1)")
sDate = Format(sDate, "mm/dd/yy")

sDay = Evaluate("=TODAY()-IF(WEEKDAY(TODAY())=2,3,1)")
sDay = Format(sDate, "dddd")

Range("A2").Select
Selection.Formula = sDate & " " & sDay

End Sub
 
G

Gary Keramidas

or just change your last line:

Selection.Formula = sDate & " " & UCase(sDay)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top