Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default excel's range item method

I'm not sure why you are asking that particular question. There is an
ActiveCell object which is always set to the active cell (so you can find
out any Range-type information about the active cell using it), but that has
nothing to do with the xlUp constant I used as an argument to the End
method. For example, in this line...

ActiveCol = ActiveCell.Column

I used the ActiveCell object to find out what column the active cell was in.
Then in this line...

LastRow = .Cells(.Rows.Count, ActiveCol).End(xlUp).Row

used that column to search from the bottom-most cell in column... that is
what .Cells(.Rows.Count,ActiveCol) is... upward (that is what the xlUp is
for) to the first cell encountered with data in it (the first cell with data
in it traveling from the last cell in a column upward is the last cell with
data in it looking downward from Row 1 in that column). Once I had that
cell, the Row property tells me what number that row is. Then, I iterated
from the starting row to that last row which is how you would iterate the
cells individually in that column.

--
Rick (MVP - Excel)


"Sean Farrow" wrote in message
...
Is there an xlCurrentcell, rather than xlup?
Cheers
Sean.s
"Rick Rothstein" wrote in message
...
An "enumeration constant"? I'm not sure what that means.

--
Rick (MVP - Excel)


"Sean Farrow" wrote in message
...
is there an excel enumeration constant for the current cel?
Cheers.
Sean.
"Rick Rothstein" wrote in message
...
Your mention of "active window" and "type library" have me wondering
whether you are trying to look at different sessions of Excel running
concurrently as opposed to just looking at the active workbook within a
single session of Excel. I'll assume the latter as that would be the
most logical. See if this code does what you want...

Dim X As Long
Dim LastRow As Long
Dim ActiveCol As Long
ActiveCol = ActiveCell.Column
With ActiveSheet
LastRow = .Cells(.Rows.Count, ActiveCol).End(xlUp).Row
End With
For X = 1 To LastRow
'
' Your code goes here... use Cells(X, ActiveCol)
' to reference the cell being iterated per loop...
'
' For example: Debug.Print Cells(X, ActiveCol).Value
'
Next

--
Rick (MVP - Excel)


"Sean Farrow" wrote in message
...
Hi:
in the excel 2000 type library.
Basically what I want to do, is iterate down all rows in the collumn
of the activecell on the activeshet in the active window.
Any help apreciated.
Sean.
"JLGWhiz" wrote in message
...
Same question I had, Rick. The Item method works with the collection
index
as far as I can tell. I see nothing related to lcid or final string
mentioned in any of the dialog.

"Rick Rothstein" wrote:

Where are you looking that you see the Item method for the Range
object
having four arguments?

--
Rick (MVP - Excel)


"Sean Farrow" wrote in message
...
Hi:
What are the parameters for the item method of the range object?
I have understand the first two row and collumn index, what are
the last
two lcid and the final string parameter?
Any help apreciated.
Sean.












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
CDO, SMTP Server Name, and Excel's SendMail Method Greg Lovern Excel Programming 4 June 10th 07 08:18 PM
Search Range for item in seperate range [email protected][_2_] Excel Programming 6 January 9th 06 03:53 PM
sum item within certain date range kwong Excel Discussion (Misc queries) 3 August 15th 05 11:46 AM
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
Excel's range Union operator in WORKDAY function gives #VALUE!. Rod Morrell Excel Programming 0 October 9th 03 02:59 PM


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