Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Help please
When using the Range("B1:B50").Select I want to substitute a variable into the Range. I have a variable which is a number e.g test=50 Therefore the command I want is Range(B1:B'test'").Select I cannot get the syntax right. Idea is to select a range of data based on variables. Is this the right way? Cheers David |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
David,
Range("B1:B" & test) hth, Doug Glancy "DavidC" wrote in message ... Help please When using the Range("B1:B50").Select I want to substitute a variable into the Range. I have a variable which is a number e.g test=50 Therefore the command I want is Range(B1:B'test'").Select I cannot get the syntax right. Idea is to select a range of data based on variables. Is this the right way? Cheers David |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
David,
Since the argument of the Range object is a string, you can manipulate it just as you would any other string: TestRng = "B1:B"&test Range(TestRng) or just Range("B1:B"&test) Good luck! -- David "DavidC" wrote in message ... Help please When using the Range("B1:B50").Select I want to substitute a variable into the Range. I have a variable which is a number e.g test=50 Therefore the command I want is Range(B1:B'test'").Select I cannot get the syntax right. Idea is to select a range of data based on variables. Is this the right way? Cheers David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Public variable usage! | Excel Programming | |||
Public variable usage! | Excel Programming | |||
Public variable usage! | Excel Programming | |||
freeze pane command usage | Excel Programming | |||
Command Usage | Excel Programming |