S
stan
New to VBA
I'm using the following code which is based on a range:
Sub update_finance()
'
If Range("b4").Value = "expenses1" Then Workbooks.Open
"C:\expenses1.xlsm"
Windows("dollars.xlsm").Activate
Sheets("Estimate").Select
Application.Run "'dollars.xlsm'!SAVE_expenses1"
If Range("b4").Value = "expenses2" Then Workbooks.Open "C:\expenses2.xlsm"
Windows("dollars.xlsm").Activate
Sheets("Estimate").Select
Application.Run "'dollars.xlsm'!SAVE_expenses2"
End Sub
--
"expenses1" runs OK but when I use "expenses2" in the cell it flips back to
the first one. I will have six range variables when I'm done but I didn't
see much sense in moving on until the first two are resolved.
Not sure how to remedy: if-then-else?
stan
I'm using the following code which is based on a range:
Sub update_finance()
'
If Range("b4").Value = "expenses1" Then Workbooks.Open
"C:\expenses1.xlsm"
Windows("dollars.xlsm").Activate
Sheets("Estimate").Select
Application.Run "'dollars.xlsm'!SAVE_expenses1"
If Range("b4").Value = "expenses2" Then Workbooks.Open "C:\expenses2.xlsm"
Windows("dollars.xlsm").Activate
Sheets("Estimate").Select
Application.Run "'dollars.xlsm'!SAVE_expenses2"
End Sub
--
"expenses1" runs OK but when I use "expenses2" in the cell it flips back to
the first one. I will have six range variables when I'm done but I didn't
see much sense in moving on until the first two are resolved.
Not sure how to remedy: if-then-else?
stan