LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

 
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
Macro Creating Variable and using variable in a SQL statement Jimmy Excel Programming 4 October 25th 04 02:36 AM
If-Then statement with variable range bjsto2 Excel Programming 7 June 27th 04 11:34 PM
Variable in Range statement Mike Excel Programming 2 December 14th 03 04:08 AM
Case statement in variable range TP[_3_] Excel Programming 1 August 23rd 03 05:14 PM
Passing a variable to a range statement Mervyn Thomas[_3_] Excel Programming 3 July 25th 03 02:40 PM


All times are GMT +1. The time now is 03:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"