LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default UBound

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
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
Why is this returning a Ubound value of zero [email protected] Excel Discussion (Misc queries) 1 September 28th 07 07:44 PM
resize(Ubound, Lbound) ina Excel Programming 4 May 1st 06 02:55 PM
Array Ubound gti_jobert[_71_] Excel Programming 6 March 27th 06 10:34 PM
Ubound & Lbound Michael168[_80_] Excel Programming 3 June 1st 04 02:00 PM


All times are GMT +1. The time now is 09:54 AM.

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"