#1   Report Post  
Nigel
 
Posts: n/a
Default SaveAS macro Query

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
  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

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


"Nigel" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saveas Macro Nigel Excel Discussion (Misc queries) 3 May 11th 05 01:15 PM
"Query cannot be edited by the Query Wizard" PancakeBatter Excel Discussion (Misc queries) 0 April 25th 05 05:59 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM


All times are GMT +1. The time now is 07:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"