SaveAS macro Query

N

Nigel

Hi,

Can anyone help me with my macro? Basically, it is supposed to look at the
book name and rename it if it is call Quotes & Orders to a value ( which is a
job number) in C2.
in an ideal world, i would like to save it to the following:
S:/Clients/(get client name from cell C1)/(Get Project Name from C3/(Get Job
Number from C2) Quotes & Orders.xls

Any Help Greatly appreciated.
Regards,

Nigel

sub SaveThisBook()
Revision = ActiveWorkbook.Name
RevName = Range("2").Value

if ActiveWorkbook.Name = "Quotes & Orders.xls" then
SaveAs = RevName & " " & Revision
End If
If ActiveWorkbook.Name = "" Then
msgbox " This Book Has Already Been Named. Please Review Book Name"
End if
End Sub
 
B

Bernie Deitrick

Nigel,

Try:

If ActiveWorkbook.Name = "Quotes & Orders.xls" Then
ActiveWorkbook.SaveAs "S:\Clients\" & Range("C1").Value & _
"\" & Range("C3").Value & "\" & Range("C2").Value & _
" Quotes & Orders.xls"
End If

You might want to fully qualify the ranges to specify the sheet that the
values should be pulled from.

HTH,
Bernie
MS Excel MVP
 

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