View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Upper Case Macro

What did you dim it as ? It should be

Dim c as Range

Mike

"Phil H" wrote:

I added the Dim line, but get compile error:
"For Each control variable must be Variant or Object."

Sub ChangeToUpperCase()
Dim c As String
For Each c In Selection
c.Formula = UCase(c.Formula)
Next
End Sub

Former submariner?

"Mike H" wrote:

Hi,

Attach this to a button

Sub Marine()
For Each c In Selection
c.Formula = UCase(c.Formula)
Next
End Sub

Mike

"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?