save as using a vba button more than once

justundertall

New Member
Joined
Mar 22, 2021
Messages
21
Office Version
  1. 2013
Platform
  1. Windows
Good day,

I wasn't able to find a thread on this so I hope that I'm not asking something that was already answered.

I currently have a button that will save a specific worksheet as a pdf to a specific folder with a specific file name using a specific amount of info based on the spreadsheet (customer Name, JobName, Estimate Number)
My question is if I save it more than once it seems to overwrite the current document. I need to keep track of every change made to the Estimate so I don't want it to overwrite the document save previously. I want to make a duplicate and have the file name based on the same info (customer Name, JobName, Estimate Number) but have a number (1) or a (2) behind it depending on how many times it been saved.

Is that even possible? if this is possible then i will need to do the same thing for the whole work book and save it as a an excel workbook the same way.

this is the current code i have
1616596134232.png


this is a snip of the spreadsheet that the file name is based off of
1616596185383.png


and this is the file where it is saving to and how the file name turns out based on the info from the spreadsheet
1616596240746.png


thanks for the he
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Watch MrExcel Video

Forum statistics

Threads
1,130,089
Messages
5,640,052
Members
417,124
Latest member
Herostrata

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
Top