LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Upper Case Macro


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert lower to upper case automatically without using UPPER Sal Excel Discussion (Misc queries) 6 July 26th 09 11:27 AM
Changing file in all upper case to upper and lower case Sagit Excel Discussion (Misc queries) 15 May 30th 07 06:08 AM
UPPER case in a macro [email protected] Excel Programming 1 January 3rd 07 02:41 PM
How do I convert all upper case excel sheet into upper and lower . DebDay Excel Discussion (Misc queries) 1 March 9th 05 08:31 PM
UPPER CASE macro shortcut key anomaly beetle Excel Programming 4 October 25th 04 02:55 AM


All times are GMT +1. The time now is 07:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"