Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What you write is true. I'm not sure how it relates to my code fragment
posted and the issue I was having with it. Let me put a pair of comments in the fragment to better explain: For Each myRow In myRange.Rows ' is it a line we need to get the column data from? If myRow.Cells(, ColX) = AmagicValue Then ' if it's magic, let's iterate on the cells of this row_ from column ColY to column ColZ For Each myCell In myRow.Range( _ myRow.Cells(, ColY), _ myRow.Cells(, ColZ) _ ).Cells ' do what we need to do with each of the _ subset of cells in our columns in the magic row ' problem was that here myCell.Address was pointing _ to a different row than myRow.Address, thus_ hosing everything up Next myCell End If Next myRow ' problem wasn't a reference to myRow or _ myCell here outside of the For Each... In any event, Jakob's posting sorted it out. Thanks for offering to help! "Joel" wrote in message ... No. See comments below. For Each myRow In myRows.Rows For Each myCell In myRow.Range( _ Next myCell Next myRow 'this statement is not valid since myrow is outside the for loop RowCount = myrow.row |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Iterating Thru Cells | Excel Programming | |||
Iterating thru cells & comparing | Excel Programming | |||
Iterating through cells problem | Excel Programming | |||
Iterating through cells problem | Excel Programming | |||
Iterating through Cells .Net/Excel 2003 | Excel Programming |