![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,027
|
Hey all,
Kind of a general syntax question but it's simple enough to explain. This may remind you of the INDIRECT function. The Brief History: Somewhere in my current code I have an Object Variable (I'll call "x") that eventually gets assigned an integer value (via a calculation). The code I have so far to get this integer value works great. My question relates to the next step. By design, the end value for X is actually a row number. For example sake, say the current code ends in setting X = 34. What I'd like to do is use that Object Variable as a way to select a cell in Column B (B34 in this example). How do you code this? I've tried (with dismal failure) code similar to this: Range("B:"&X).Select (or) Range(""B:"&X").Select ...I know I'm missing something really basic - but I'm starting to go NUTS! Thanks! Adam S. |
|
|
|
|
|
#2 | |
|
Board Regular
Join Date: Feb 2002
Location: Chippenham, UK
Posts: 136
|
Quote:
Range("B"&X).Select ' or use.Activate If you are still having problems try stepping through the code to make sure that the variable x IS being assigned a value.
__________________
Regards, Gary Hewitt-Long |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,027
|
That Damn Colin!!
Thanks, man. I was going Crazy! |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,027
|
Colin = Colon
I was so happy you posted my answer I forgot how to spell! |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|