#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default UCase Help


How can I create a macro to UCase an entire spreadsheet ? I'd like t
utilize this function to make sure all characters on the sheet ar
Uppercase

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default UCase Help

Sub UcaseUs()
Dim R As Range, C As Range
On Error Resume Next
Set R = Selection
Set R = Intersect(R, ActiveSheet.UsedRange)
Set R = R.SpecialCells(xlCellTypeConstants, 2)
If R Is Nothing Then Exit Sub
For Each C In R
C.Formula = UCase$(C.Formula)
Next
End Sub

Select any range of cells and run.
--
HTH. Best wishes Harald
Followup to newsgroup only please

"holder2k" skrev i melding
...

How can I create a macro to UCase an entire spreadsheet ? I'd like to
utilize this function to make sure all characters on the sheet are
Uppercase.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default UCase Help

Hi holder2k

See this webpages
http://www.mvps.org/dmcritchie/excel/proper.htm
Or
http://www.cpearson.com/excel/case.htm

Here is a macro for changing the cells with text in the selection

Sub Uppercase_macro()
Dim selectie As Range
Dim cel As Range
On Error Resume Next
Set selectie = Range(ActiveCell.Address & "," & Selection.Address) _
.SpecialCells(xlCellTypeConstants, xlTextValues)
If selectie Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For Each cel In selectie
cel.Value = UCase(cel.Value)
Next cel
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"holder2k" wrote in message ...

How can I create a macro to UCase an entire spreadsheet ? I'd like to
utilize this function to make sure all characters on the sheet are
Uppercase.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



Reply
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
Ucase / macros MrDave Excel Discussion (Misc queries) 1 July 26th 09 11:07 AM


All times are GMT +1. The time now is 05:35 AM.

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

About Us

"It's about Microsoft Excel"