Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Enter WEDNESDAY, not Wednesday
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 -- achidsey |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Enter WEDNESDAY, not Wednesday
Hi,
Try with Ucase ... ... = sDate & " " & UCase(sDay) -- Regards, Sébastien <http://www.ondemandanalysis.com "achidsey" wrote: 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 -- achidsey |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Enter WEDNESDAY, not Wednesday
Perfect. Thanks Sebastienm. Alan -- achidsey "sebastienm" wrote: Hi, Try with Ucase ... ... = sDate & " " & UCase(sDay) -- Regards, Sébastien <http://www.ondemandanalysis.com "achidsey" wrote: 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 -- achidsey |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Enter WEDNESDAY, not Wednesday
or just change your last line:
Selection.Formula = sDate & " " & UCase(sDay) -- Gary "achidsey" (notmorespam) wrote in message ... Perfect. Thanks Sebastienm. Alan -- achidsey "sebastienm" wrote: Hi, Try with Ucase ... ... = sDate & " " & UCase(sDay) -- Regards, Sébastien <http://www.ondemandanalysis.com "achidsey" wrote: 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 -- achidsey |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Return the first Wednesday of each month | Excel Worksheet Functions | |||
How to set formula for poping up the date of next Wednesday.... | Excel Worksheet Functions | |||
Excel Bi-weekly time sheet change dates to Thursday- Wednesday? | New Users to Excel | |||
Save Excel File every wednesday VB Script Help !! | Excel Discussion (Misc queries) | |||
Determine every wednesday based off year | Excel Discussion (Misc queries) |