When I ask for a range on the inputbox and select a range of cells, I can see the filename and tab information in the inputbox graphic, but that information does not output into my formula? In the following code, I would rather the inputbox gather the filename and tab instead of hard coding it into my PROJECTFORMULA.
Any help would be appreciated.
Any help would be appreciated.
VBA Code:
Sub NEW_PROJECT_BILLING_FORMULA()
Dim STARTMONTH As String
Dim PROJECTRANGE As String
Dim PROJECTFORMULA As String
Dim FORMULALOCATION As String
STARTMONTH = Application.InputBox("Start Month.", "Select Cell", Type:=8).Address(False, False)
PROJECTRANGE = Application.InputBox("Project Date Range.", "Select Cells", Type:=8).Address
FORMULALOCATION = Application.InputBox("Location to place new formula.", "Select Cell", Type:=8).Address(False, False)
PROJECTFORMULA = "=IFERROR(VLOOKUP(" & STARTMONTH & ",'G:\Shared drives\CGA Accounting\- Project Tracker\New Project Tracker Build folder\[MO Project tracker .xlsx]MO PROJECT S-W 3'!" & PROJECTRANGE & ",2,FALSE),0)"
Range(FORMULALOCATION).Formula = PROJECTFORMULA
End Sub