View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
papou[_4_] papou[_4_] is offline
external usenet poster
 
Posts: 110
Default Macro not working in 2007

Hi Rick
What is the error message?
But never mind, obviously the code is correct, so i would think this is
probably due to the missing declaration of x.
In which case amend:
Sub Uppercase()
' Loop to cycle through each cell in the specified range.
Dim x As Range
For Each x In Range(Selection, Selection.End(xlDown))
' Change the text in the range to uppercase letters.
x.Value = UCase(x.Value)
Next x
End Sub

HTH
Cordially
Pascal

"Rick" a écrit dans le message de news:
...
I had the below macro to change text into Uppercase in Excel 2003 but now
in
2007 it doesn't work.

It seems to get stuck on the For Each x.

Can anyone tell me why?

Thanks
Rick


Sub Uppercase()
' Loop to cycle through each cell in the specified range.
For Each x In Range(Selection, Selection.End(xlDown))
' Change the text in the range to uppercase letters.
x.Value = UCase(x.Value)
Next
End Sub