Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Select a variable range Bluecat Excel Worksheet Functions 7 January 13th 09 01:24 AM
Use a Variable to select a range Connie Excel Discussion (Misc queries) 3 October 19th 06 05:48 PM
select range and put range address in variable [email protected] Excel Programming 2 January 25th 06 01:28 AM
Select a Range Through a Variable GoFigure[_9_] Excel Programming 3 December 6th 05 01:02 PM
Range.Select with variable cells ? [email protected] Excel Programming 2 October 29th 03 08:43 PM


All times are GMT +1. The time now is 12:50 PM.

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"