Traversing the collumn of the active cell
There should only be two ll (not 3). The line gets the last cell with data
in the column. cells.count is a constant in excel that represents the last
column on the worksheet like in excel 2003 which is column 256.
end(xltoleft) move from column 256 to the left until a cell with data is
found.
You didn't specify how many columns you needed to transverse.
"Sean Farrow" wrote:
Hi:
What does the line:
LastCol = cellls(activecell.row,columns.count).end(xltoleft) .column
Achieve?
Cheers
Sean.
"Joel" wrote in message
...
LastCol = cellls(activecell.row,columns.count).end(xltoleft) .column
For ColCount = 1 to Lastcol
Data = .cells(Activecell.row,ColCount)
if Data = "ABC" then
'enter your code here
end if
next ColCount
"Sean Farrow" wrote:
Hi:
I need to traverse the collums of the active cell looking for data, can I
use:
ActiveCell.Collumn.cells in a foreeach loop?
Any help apreciated.
Sean.
|