vincecodegreeen
New Member
- Joined
- Jan 17, 2014
- Messages
- 39
I have need for a function to be a part of the VBA code. {=IF(H47>0,CELL("address",OFFSET(TDC!B9,0,MATCH(LARGE(IF(TDC!B9:H9>0,(TDC!B9:H9)),N47),TDC!B9:H9,0)-1)),
CELL("address",OFFSET(TDC!B9,0,MATCH(SMALL(IF(TDC!B9:H9>0,(TDC!B9:H9)),N47),TDC!B9:H9,0)-1)))}
Not knowing how to write this directly into the VBE I recorded it in via the F2 enter.
This doesn't save it as a true array. When I run it and call up the cell formula, it has lost its brackets and when I restore them I get the right answer.
The LARGE and SMALL functions do function as arrays (perhaps that is inherent in its function) but the "IF(TDC!B9:H9>0," is not recognised and the cell with the smallest number returns 0.
Can anyone tell me how to preserve the array in VBA?
Thanks,
Vince
CELL("address",OFFSET(TDC!B9,0,MATCH(SMALL(IF(TDC!B9:H9>0,(TDC!B9:H9)),N47),TDC!B9:H9,0)-1)))}
Not knowing how to write this directly into the VBE I recorded it in via the F2 enter.
This doesn't save it as a true array. When I run it and call up the cell formula, it has lost its brackets and when I restore them I get the right answer.
The LARGE and SMALL functions do function as arrays (perhaps that is inherent in its function) but the "IF(TDC!B9:H9>0," is not recognised and the cell with the smallest number returns 0.
Can anyone tell me how to preserve the array in VBA?
Thanks,
Vince