VBA coding for all capital letters

M

MissH

I know absolutely nothing about VBA coding. I am trying to return the date using the today function in all capital letters. I searched and seen some VBA coding for this but I don't know the first thing about how to get started. Can someone help?
 
D

Don Guillett

put this in your personal.xls and use as desired.

Sub ChangeCase() 'Don Guillett
Application.ScreenUpdating = False
Dim r As Range
nCase = UCase(InputBox("Enter U for UPPER" & Chr$(13) & " L for
lower" & Chr$(13) & " Or " & Chr$(13) & " P for Proper", "Select
Case Desired"))
Select Case nCase
Case "L"
For Each r In Selection.Cells
If r.HasFormula Then
r.Formula = LCase(r.Formula)
'R.Formula = R.Value
Else
r.Value = LCase(r.Value)
End If
Next

Case "U"
For Each r In Selection.Cells
If r.HasFormula Then
r.Formula = UCase(r.Formula)
'R.Formula = R.Value
Else
r.Value = UCase(r.Value)
End If
Next
Case "P"

For Each r In Selection.Cells
If r.HasFormula Then
r.Formula = Application.Proper(r.Formula)
'R.Formula = R.Value
Else
r.Value = StrConv(r.Value, vbProperCase)
End If
Next
End Select
Application.ScreenUpdating = True
End Sub

--
Don Guillett
SalesAid Software
[email protected]
MissH said:
I know absolutely nothing about VBA coding. I am trying to return the date
using the today function in all capital letters. I searched and seen some
VBA coding for this but I don't know the first thing about how to get
started. Can someone help?
 
T

Tushar Mehta

What does it mean to have a date in uppercase? Today's date, for
example is 05/15/2004 in one particular format and 15/05/2004 in
another format and...and...and stored in XL as a number of days since
1900 (or, depending on an option, 1904).

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
D

Don Guillett

After re-reading your post
Sub todayincaps()
MsgBox UCase(Format(Date, "DDD"))
'or
range("a2")=UCase(Format(Date, "DDD"))
End Sub


--
Don Guillett
SalesAid Software
[email protected]
MissH said:
I know absolutely nothing about VBA coding. I am trying to return the date
using the today function in all capital letters. I searched and seen some
VBA coding for this but I don't know the first thing about how to get
started. Can someone help?
 
R

Rob van Gelder

Perhaps you're looking for a formula:
=UPPER(TEXT(TODAY(), "DD-MMM-YYYY"))

--
Rob van Gelder - http://www.vangelder.co.nz/excel


MissH said:
I know absolutely nothing about VBA coding. I am trying to return the date
using the today function in all capital letters. I searched and seen some
VBA coding for this but I don't know the first thing about how to get
started. Can someone help?
 
Top