View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Alfarata Alfarata is offline
external usenet poster
 
Posts: 1
Default Can I use a variable in a Range statement


I have tried to use a variable in this Range satement but I get a Select
Method of Range Class Failed. I need to reformat this as I move data.
X is a changing row variable.
Any help would be greatly appreciated
Thanks
Bill
Dim Temp as String
Temp = "O" & X

If TopInches < 10 Then
Range(Temp).Select
Selection.NumberFormat = "## ""' "" 0 ##/##"
Else
Range(Temp).Select
Selection.NumberFormat = "## ""' "" #0 ##/##"
End If


--
Alfarata
------------------------------------------------------------------------
Alfarata's Profile: http://www.excelforum.com/member.php...o&userid=34360
View this thread: http://www.excelforum.com/showthread...hreadid=548833