Home |
Search |
Today's Posts |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() If Not r.HasFormula Then r.Value = UCase(r.Value) else r.formula = "=UPPER(" & right(r.formula,len(r.formula)-1) & ")" end if maybe "Sam Wilson" wrote: True, but imagine A1 = "BlahBlahBlah" B1 = "=A1" If you use ucase(Range("B1").formula) you won't end up with BLAHBLAHBLAH Sam "Mike H" wrote: Sam, Using .value is taking an unnecessary risk. What it will do is change any formula selected (maybe by accident) to values. Use .formula instead or check using something like If Not r.HasFormula Then r.Value = UCase(r.Value) Mike "Sam Wilson" wrote: Sub upper() Dim r As Range For Each r In Selection r.Value = UCase(r.Value) Next r End Sub "Phil H" wrote: I need a macro, which will be attached to a button, to change text to upper case for any range of selected cells. Can someone help? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
convert lower to upper case automatically without using UPPER | Excel Discussion (Misc queries) | |||
Changing file in all upper case to upper and lower case | Excel Discussion (Misc queries) | |||
UPPER case in a macro | Excel Programming | |||
How do I convert all upper case excel sheet into upper and lower . | Excel Discussion (Misc queries) | |||
UPPER CASE macro shortcut key anomaly | Excel Programming |