View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default UPPER and Proper Case

Be aware that running this code on any cell(s) with Formulas will turn those
formulas to values.

The results of this change may not be too desirable.

Gord Dibben Excel MVP

On Sun, 1 Feb 2004 15:20:45 -0600, Padgett
wrote:

Ever thought of just making a couple written macros and applying them to
your own toolbar, or menubar?

The following code will change a cell to UPPER, lower or Proper
depending on how many times you click the Icon you assign it too.


Sub SwitchCase()
Dim Cell As Range
For Each Cell In Selection
Select Case Cell
Case LCase(Cell) 'It's lowercase
Cell = UCase(Cell)
Case UCase(Cell) 'It's uppercase
Cell = Application.Proper(Cell)
Case Else 'It's neither upper nor lower
Cell = LCase(Cell)
End Select
Next
End Sub



Good Luck!


---
Message posted from http://www.ExcelForum.com/