jerry12302
Active Member
- Joined
- Apr 18, 2005
- Messages
- 449
- Office Version
- 2010
- Platform
- Windows
I can have several different functions in one function in a cell in a worksheet, for example:
=INDEX(OFFSET(my1rangename,0,1),MATCH($A$1,my1rangename,0),1)
But I can't seem to do that in VBA with WorksheetFunction, the following will not work:
X = WorksheetFunction.Index(Offset(Range("my1rangename"),Match(myvariable, Range("my1rangename"), 0), 1)
I have to use multiple lines, and in this case, define a new range:
X = WorksheetFunction.Match(myvariable, Range("my1rangename"), 0)
Y = WorksheetFunction.Index(Range("mynewrange"),X, 1)
Is there a way to include multiple functions in one line of WorksheetFunction code?
=INDEX(OFFSET(my1rangename,0,1),MATCH($A$1,my1rangename,0),1)
But I can't seem to do that in VBA with WorksheetFunction, the following will not work:
X = WorksheetFunction.Index(Offset(Range("my1rangename"),Match(myvariable, Range("my1rangename"), 0), 1)
I have to use multiple lines, and in this case, define a new range:
X = WorksheetFunction.Match(myvariable, Range("my1rangename"), 0)
Y = WorksheetFunction.Index(Range("mynewrange"),X, 1)
Is there a way to include multiple functions in one line of WorksheetFunction code?