himperson1
New Member
- Joined
- Jun 23, 2016
- Messages
- 33
i've defined a variable in vba and am now trying to get a function to call it. the value assigned to the variable is correctly being defined when i mouse over it, but i'm getting an error when the macro tries to run the function part of the code.
This is the array formula that i'm trying to emulate: {=MATCH(1,(B1:CP1=A7)*(B2:CP2=B7),0)}
This is the array formula that i'm trying to emulate: {=MATCH(1,(B1:CP1=A7)*(B2:CP2=B7),0)}
Rich (BB code):
Dim myDay As Variant
Dim myShift As Variant
myDay = InputBox("Enter day of the month")
myShift = InputBox("Enter your shift")
Locate = Application.WorksheetFunction.Match(1, (Sheets("Trend").Range("B1:CP1") = myDay) * (Sheets("Trend").Range("B2:CP2") = myShift), 0)
' Worksheets("Inventory").Range("B12").Copy Worksheets("Trend").Range("location based on index/match").Offset(1,0)
' Worksheets("Inventory").Range("B27").Copy Worksheets("Trend").Range("Location based on index/match").Offset(1,-1)
' Worksheets("Inventory").Range("B36").Copy Worksheets("Trend").Range("Location based on index/match").Offset(1,-2)
Last edited: