#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Theuns


Please help me with the following:

I need to select a range of information, for example
Sheet1.Range("A17:K17")
but due to variable incoming information i need to cupple the range to
a variable so that a variable range get selected

example: Dim z as integer
z = 10
sheet1.range("A" & Z).select
I know that A10 will be
selected

but Sheet1.Range("A17:K17") ?????????


--
T.c.Goosen1977
------------------------------------------------------------------------
T.c.Goosen1977's Profile: http://www.excelforum.com/member.php...o&userid=35895
View this thread: http://www.excelforum.com/showthread...hreadid=556832

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Theuns

RowNum=10
sheet1.range("A" & RowNum & ":Z" & RowNum).select

--
Jim
"T.c.Goosen1977"
<T.c.Goosen1977.2a5snn_1151576705.7204@excelforu m-nospam.com wrote in
message news:T.c.Goosen1977.2a5snn_1151576705.7204@excelfo rum-nospam.com...
|
| Please help me with the following:
|
| I need to select a range of information, for example
| Sheet1.Range("A17:K17")
| but due to variable incoming information i need to cupple the range to
| a variable so that a variable range get selected
|
| example: Dim z as integer
| z = 10
| sheet1.range("A" & Z).select
| I know that A10 will be
| selected
|
| but Sheet1.Range("A17:K17") ?????????
|
|
| --
| T.c.Goosen1977
| ------------------------------------------------------------------------
| T.c.Goosen1977's Profile:
http://www.excelforum.com/member.php...o&userid=35895
| View this thread: http://www.excelforum.com/showthread...hreadid=556832
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Theuns

One mo

Dim Z as long
Z = 17
Sheet1.select
sheet1.range("a" & z).resize(1,11).select
'or
sheet1.cells(z,"A").resize(1,11).select

resize(x,y) means to make it x rows deep and y columns wide.

(And sheet1 has to be selected before you can select any range on that sheet.)

"T.c.Goosen1977" wrote:

Please help me with the following:

I need to select a range of information, for example
Sheet1.Range("A17:K17")
but due to variable incoming information i need to cupple the range to
a variable so that a variable range get selected

example: Dim z as integer
z = 10
sheet1.range("A" & Z).select
I know that A10 will be
selected

but Sheet1.Range("A17:K17") ?????????

--
T.c.Goosen1977
------------------------------------------------------------------------
T.c.Goosen1977's Profile: http://www.excelforum.com/member.php...o&userid=35895
View this thread: http://www.excelforum.com/showthread...hreadid=556832


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Theuns


Thanks it works like a bom

regards
Theun

--
T.c.Goosen197
-----------------------------------------------------------------------
T.c.Goosen1977's Profile: http://www.excelforum.com/member.php...fo&userid=3589
View this thread: http://www.excelforum.com/showthread.php?threadid=55683

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
Theuns T.c.Goosen1977 Excel Programming 1 June 29th 06 11:45 AM


All times are GMT +1. The time now is 02:51 PM.

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

About Us

"It's about Microsoft Excel"