Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
select a variable range
I want to select coloums A-BR of different rows in a loop. How do I setup the Range (A[some_number]:BR[some_number]).select the number will change a few times and wont be the same everytime I run the macro -- evil baby ------------------------------------------------------------------------ evil baby's Profile: http://www.excelforum.com/member.php...o&userid=31983 View this thread: http://www.excelforum.com/showthread...hreadid=520237 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
select a variable range
Something like this but change your do while to what you need.
Dim x, y As Single x = 1 y = 1 Do While Range("B" & x).Value < "" Range("A" & x & ":AR" & y).Select x = x + 1 y = y + 1 Loop |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
select a variable range
Try something like this
dim lngThisNumber as long dim lngThatNumber as long lngThisNumber = 1 lngThatNumber = 12345 range(cells(lngThisNumber, "A"), cells(lngThatNumber, "BR").Select -- HTH... Jim Thomlinson "evil baby" wrote: I want to select coloums A-BR of different rows in a loop. How do I setup the Range (A[some_number]:BR[some_number]).select the number will change a few times and wont be the same everytime I run the macro -- evil baby ------------------------------------------------------------------------ evil baby's Profile: http://www.excelforum.com/member.php...o&userid=31983 View this thread: http://www.excelforum.com/showthread...hreadid=520237 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
select a variable range
for i = 1 to 20
cells(i,1).Resize(1,70).Select msgbox selection.Address Next -- Regards, Tom Ogilvy "evil baby" wrote in message ... I want to select coloums A-BR of different rows in a loop. How do I setup the Range (A[some_number]:BR[some_number]).select the number will change a few times and wont be the same everytime I run the macro -- evil baby ------------------------------------------------------------------------ evil baby's Profile: http://www.excelforum.com/member.php...o&userid=31983 View this thread: http://www.excelforum.com/showthread...hreadid=520237 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
select a variable range
Thanks for the help again I ended up using Range("A" & x, "L" & x).Select and just setting x to activecell -- evil baby ------------------------------------------------------------------------ evil baby's Profile: http://www.excelforum.com/member.php...o&userid=31983 View this thread: http://www.excelforum.com/showthread...hreadid=520237 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Select a variable range | Excel Worksheet Functions | |||
Use a Variable to select a range | Excel Discussion (Misc queries) | |||
select range and put range address in variable | Excel Programming | |||
Select a Range Through a Variable | Excel Programming | |||
Range.Select with variable cells ? | Excel Programming |