Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Displaying the extent of a range variable

What is the easy way of displaying the range of cells which is assigned to a
range variable? This is for debugging purposes, and I just want a property of
the variable which I can display with debug.print which will show me which
cells are in the range.

Grateful for advice.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Displaying the extent of a range variable

MsgBox (r.Parent.Name)
MsgBox (r.Address)

will display both the cells and the sheetname.
--
Gary''s Student - gsnu200825


"simonc" wrote:

What is the easy way of displaying the range of cells which is assigned to a
range variable? This is for debugging purposes, and I just want a property of
the variable which I can display with debug.print which will show me which
cells are in the range.

Grateful for advice.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Displaying the extent of a range variable

Gosh, thanks. I spent ages looking in the Locals list to find that. Who would
have thought it was so simple!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Displaying the extent of a range variable

You are very welcome.

By the way, in addition to displaying the sheetname and cells, you can use:

r.Parent.Parent.Name

to get the filename as well.
--
Gary''s Student - gsnu200825


"simonc" wrote:

Gosh, thanks. I spent ages looking in the Locals list to find that. Who would
have thought it was so simple!

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
Displaying data using a variable Maracay Excel Discussion (Misc queries) 1 December 8th 09 02:41 PM
Excel 2007 SP1 - How to correct scrollbar extent? Ron West Excel Discussion (Misc queries) 1 January 2nd 09 03:31 PM
Testing Range Extent Nigel RS[_2_] Excel Programming 2 May 17th 07 10:15 AM
Displaying the Highest Value in a user-variable range of cells Tabby Excel Programming 1 April 26th 05 09:12 PM
Defining Range Extent Nigel[_4_] Excel Programming 2 October 5th 03 12:10 PM


All times are GMT +1. The time now is 06: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"