MyValue

S

StephanieH

I'm trying to create a macro that will save my file in another location each
month. On of the variables is a folder in the pathname. For some reason, I
can't get it to accept my variable. Here's my example
MyValue = InputBox("Enter Month # ____ YYYY_MM", "Central Analytics")

Windows("MPA Internal.xls").Activate

ActiveWorkbook.SaveAs Filename:= _
"I:\EXLDATA\Loan Recovery MIS\" & MyValue & "\Outstandings\MPA
Internal.xls",
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

I've tried \MyValue\ " & MyValue & " " MyValue " &MyValue& nothings
working...
Help.
 
S

Stratuser

Try creating the whole filename as a string variable, and then using that
variable in the SaveAs command, rather than doing the string concatenation in
the SaveAs command.
 
D

Dave Peterson

I'm guessing that it isn't your code that's the problem.

Are you sure that this folder exists?
"I:\EXLDATA\Loan Recovery MIS\" & MyValue & "\Outstandings"

===
What does the user type into that inputbox? And what do you expect?

If I type 2, do you need 02?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top