LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Re-define a range in cells

Hi
How do i re-define the following range in cell notation so variables can be
used for the column and row?

Dim tbl as range
Set tbl = .Range(.Range("D6"), .Range("D6:D" &
..Range("D65536").End(xlUp).Row))
Works fine but is fixed.

Dim rownum as integer
Dim colnum as integer
rownum=6 'initially
colnum=4 'initially

I just cannot get anything to work. The next line seemed ok at first and
produced the expected answer. But then it failed and in testing i found it
produced "D5:Dxxxx and not D6:Dxxxx as expected.

Set tbl = .Range(.Cells(6, colnum), .Cells(65536, colnum).End(xlUp))

I would very much appreciate some help on something which seems so simple to
convert.

T.I.A.

Geoff

 
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
Define Name range Gotroots Excel Discussion (Misc queries) 10 December 19th 09 11:30 AM
How do I define a range using values in cells? Matthieu de Wit Excel Worksheet Functions 2 April 26th 06 09:43 PM
Define a range of cells in VBA Noemi Excel Discussion (Misc queries) 2 October 20th 05 04:32 AM
Define a range based on another named range Basil Excel Worksheet Functions 2 February 21st 05 01:47 PM
Define Range Name Wayne Huxman Excel Programming 3 November 21st 04 09:56 PM


All times are GMT +1. The time now is 07:15 AM.

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"