Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Im looping through a bunch of columns.
I want to store the column indexes 1, 9, 18, 21 in a cell, whose named range is Columns. Not sure how to€¦ WORKING rO = myRange.Rows.Count coLArray = Array(1, 9, 18, 21) For X_col = 0 To UBound(coLArray) For Loop_rO = 4 To rO Cells(Loop_rO, coLArray(X_col)).Select Y_CellBase = ActiveCell.Value Y_CellTest = Worksheets(2).Cells(Loop_rO, coLArray(X_col)) If Y_CellBase < Y_CellTest Then Worksheets(2).Cells(Loop_rO, coLArray(X_col)).Interior.ColorIndex = 3 End If Next Loop_rO Next X_col NOT WORKING rO = myRange.Rows.Count Columns2Check = Range("Columns") coLArray = Array(Columns2Check) For X_col = 0 To UBound(coLArray) For Loop_rO = 4 To rO Cells(Loop_rO, coLArray(X_col)).Select Y_CellBase = ActiveCell.Value Y_CellTest = Worksheets(2).Cells(Loop_rO, coLArray(X_col)) If Y_CellBase < Y_CellTest Then Worksheets(2).Cells(Loop_rO, coLArray(X_col)).Interior.ColorIndex = 3 End If Next Loop_rO Next X_col Appreciatively, Arturo |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why is this returning a Ubound value of zero | Excel Discussion (Misc queries) | |||
resize(Ubound, Lbound) | Excel Programming | |||
Array Ubound | Excel Programming | |||
Ubound & Lbound | Excel Programming |