KG Old Wolf
Board Regular
- Joined
- Sep 20, 2009
- Messages
- 65
All,
The MAX function works fine but the MATCH does not. I am trying to obtain a column number. MATCH works with hard code but I need to use a variable. As soon as I attempt to make the range a variable, it fails
Dim myRange As Range
myRange = Worksheets("tbl_Allocations").Range("E6:P6")
'
ary_Max_Value = WorksheetFunction.Max(ary_Work_Area)
ary_c_count = WorksheetFunction.Match(ary_Max_Value, Range("E6:P6"), 0)
It fails if if I use:
ary_c_count = WorksheetFunction.Match(ary_Max_Value, Range("myRange"), 0)
I cannot see what I am doing wrong... any ideas?
Thanks
The MAX function works fine but the MATCH does not. I am trying to obtain a column number. MATCH works with hard code but I need to use a variable. As soon as I attempt to make the range a variable, it fails
Dim myRange As Range
myRange = Worksheets("tbl_Allocations").Range("E6:P6")
'
ary_Max_Value = WorksheetFunction.Max(ary_Work_Area)
ary_c_count = WorksheetFunction.Match(ary_Max_Value, Range("E6:P6"), 0)
It fails if if I use:
ary_c_count = WorksheetFunction.Match(ary_Max_Value, Range("myRange"), 0)
I cannot see what I am doing wrong... any ideas?
Thanks