A
Arturo
I’m 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
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