Save As Instruction?

Ray Rz

New Member
Joined
Jun 19, 2018
Messages
29
I have a VB script that sets up a number of tables and asks for input from the user to identify 3 input files and a date field in the script. The file updates a number of tables via the refresh and then runs through to create the file. I would now like to add a save command that takes the date file the user added into cell N16 and add some text to it and save it in the same folder it existed in as a file.

I tried the following but this did not work and I figured I would ask just to check if someone had some easy solution to this issue...
The ws is identified as the worksheet prior to coming to this save but I am unsure what the code should be.

Thank you for your help.
Ray


Code:
ActiveWorkbook.Activate


SaveAs ws.Range("N16") & "- Energy - Invoice - Detail Added"
 
Last edited:

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi Ray - I apologise, but I do not understand what you want at all
Are trying to save the newly created workbook or save one worksheet (ws)
- what should its name be?
- where should it be saved?

What is the "date file" in N16 :confused:
- is it the required file name?

"Add some text to it " :confused:
- what is it? the value in N16 or the worbook itself?
- what is the text to be added?

"the same folder it existed in as a file" :confused:
- no idea what this means or how to get at the folder path
- what is it?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top