Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default definition of the range containing content

Dear experts,

how can I, in a worksheet, define the range that spans ONLY that part of the
table, that does contain content ('value').
I want compare the entries of a table with each other, using a loop that
runs through it, but stops at the last entry.

Thank you
Martin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default definition of the range containing content

If they are constants, you could use

Set rng = Range("A1:M100").SpecialCells(xlCellTypeConstants)
For Each cell in rng
...
Next cell

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Martin" wrote in message
...
Dear experts,

how can I, in a worksheet, define the range that spans ONLY that part of

the
table, that does contain content ('value').
I want compare the entries of a table with each other, using a loop that
runs through it, but stops at the last entry.

Thank you
Martin



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default definition of the range containing content

Martin,

There are a number of different ways, the best depends on the structure of your workbook. Here are a
few:

Dim myCell As Range

For Each myCell In Range("A1").CurrentRegion.Cells
For Each myCell In Range("A1:D100").SpecialCells(xlCellTypeConstants)
For Each myCell In Range("A1", Range("D65536").End(xlUp))

HTH,
Bernie
MS Excel MVP


"Martin" wrote in message
...
Dear experts,

how can I, in a worksheet, define the range that spans ONLY that part of the
table, that does contain content ('value').
I want compare the entries of a table with each other, using a loop that
runs through it, but stops at the last entry.

Thank you
Martin



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
Range Definition in Macro ? Baapi Excel Programming 1 September 23rd 05 12:08 AM
Range definition problem Peter Chatterton[_2_] Excel Programming 6 November 18th 04 08:05 PM
How come this range definition is invalid? keepITcool Excel Programming 1 June 21st 04 07:15 PM
variable range definition jmp Excel Programming 2 May 6th 04 11:06 PM
Using Cells( ) for Range definition [email protected] Excel Programming 5 September 2nd 03 08:04 PM


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