I have been struggling with this for days and days. I am guessing one of you can easily solve this. I will try to be clear. I am trying to automate input using inputbox and gather variables to plug into a formula that will output into a chosen cell. The formula only has three variables.
A cell that is D2 in the working formula below
A range that is in a different workbook that I would like the address and range to come through into the formula
and
possibly select the location that the formula will be placed.
The working formula is
=IFERROR(VLOOKUP(D2,'G:\Shared drives\CGA Accounting\- Project Tracker\New Project Tracker Build folder\[MO Project tracker .xlsx]MO PROJECT S-W 3'!$C$11:$O$37,2,FALSE),0)
What I have is as follows;
Sub NEW_PROJECT_BILLING_TRACKER()
Dim STARTMONTH As Range
Dim PROJECTRANGE As Range
Dim FORMULACELL As Range
Dim PROJECTFORMULA As String
Set STARTMONTH = Application.InputBox("Start Month.", "Select Cell", Type:=8)
Set PROJECTRANGE = Application.InputBox("Project Date Range.", "Select Cells", Type:=8)
Set FORMULACELL = Application.InputBox("LOCATION OF CELL.", "Select Cell", Type:=8)
Range("D13").Formula = "=IfError(VLookup(STARTMONTH,PROJECTRANGE, 2, False), 0)"
End sub
I can only get this to put the exact text of the range as shown into the cell. It is not picking up the variables?
Please help, I would be so grateful that I will probably donate to this site.
A cell that is D2 in the working formula below
A range that is in a different workbook that I would like the address and range to come through into the formula
and
possibly select the location that the formula will be placed.
The working formula is
=IFERROR(VLOOKUP(D2,'G:\Shared drives\CGA Accounting\- Project Tracker\New Project Tracker Build folder\[MO Project tracker .xlsx]MO PROJECT S-W 3'!$C$11:$O$37,2,FALSE),0)
What I have is as follows;
Sub NEW_PROJECT_BILLING_TRACKER()
Dim STARTMONTH As Range
Dim PROJECTRANGE As Range
Dim FORMULACELL As Range
Dim PROJECTFORMULA As String
Set STARTMONTH = Application.InputBox("Start Month.", "Select Cell", Type:=8)
Set PROJECTRANGE = Application.InputBox("Project Date Range.", "Select Cells", Type:=8)
Set FORMULACELL = Application.InputBox("LOCATION OF CELL.", "Select Cell", Type:=8)
Range("D13").Formula = "=IfError(VLookup(STARTMONTH,PROJECTRANGE, 2, False), 0)"
End sub
I can only get this to put the exact text of the range as shown into the cell. It is not picking up the variables?
Please help, I would be so grateful that I will probably donate to this site.