LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
ADK ADK is offline
external usenet poster
 
Posts: 89
Default Change cell range to Uppercase

I have found help on websites on converting a cell text to uppercase upon
entry. I would like to do this when a commandbutton is clicked instead and
go thru a select range of cells changing all cells within the range to
uppercase if not already uppercase.

Key part: "if not already uppercase"

Here is code that works but is there a way to increase its speed ...such as
scanning for lowercase ...I'm assuming that this code is literally going to
each cell and doing the procedure even if it is all uppercase.

Private Sub UpperCaseButton_Click()

On Error GoTo addError

Application.Run "Module5.UnProtectPDSR"

Dim cell As Range
Dim LastRow As String

'Process to select range
'Finds last row with next in column V
LastRow = Range("V10000").End(xlUp).Row
LastRow = "E7:J" & LastRow
Range(LastRow).Select

For Each cell In Selection.Cells
If cell.HasFormula = False Then
cell = UCase(cell)
End If
Next

Range("A7").Select
Application.Run "Module5.ProtectPDSR"

Exit Sub

addError:
MacName = "UpperCaseButton"
MyErrorRoutine Err.Number, Err.Description, MacName

End Sub



 
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
how to change cell value to uppercase automaticaly when entered indy Excel Discussion (Misc queries) 1 October 13th 06 11:49 AM
change from lowercase to uppercase Henry Excel Programming 1 March 15th 06 08:20 PM
using EVALUATE to change text to uppercase Myles[_2_] Excel Programming 5 November 30th 05 04:55 PM
How do I change certain cells to Uppercase TazDevil Excel Worksheet Functions 4 August 1st 05 06:35 AM
How do I change everything in my spreadsheet to all UPPERCASE? Bootsy Excel Discussion (Misc queries) 3 February 18th 05 09:03 PM


All times are GMT +1. The time now is 03:39 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"