Hello!
I have created an xlsm file that contains two worksheets. One of them is a locked down form that contains a list of options and pricing for our dealers. the top row is frozen and has a print, save form, email form, and reset button. The problem I am having is with the save form button. I spent almost 4 hours troubleshooting my code today but I still run into errors that I cannot seem to fix, and it doesn't really work the way I was hoping. I'm really hoping someone can give me a fresh idea on this code. Here's what I would like to happen When the button is clicked:
1. The user clicks save form button.
2. A save as dialog box pops up, defaulting to the directory the master xlsm template is in (the current directory)
3. User is only able to save as xlsm extension
4. A field on the form, J8, contains a PO number. I would like the new filename in the save as dialog field to display "existing filename PO_("J8").xlsm" or, in order to differentiate the file name if a PO is not entered, append the current date instead of the PO.
5. What I was doing was replacing the string " PO_.xlsm" with ".xlsm" to remove the PO label from the filename if they didn't enter anything in J8
6. When/if they click cancel instead of save on the dialogue box, the box should close without error :P (my major issue today) and if they click save, then the file is saved as the new name, plus the PO. If a PO is not entered, then save with the current date appended.
7. After the new file is saved, the original is left untouched/unsaved
I am sorry I don't have the code I used at the moment. It's at work, and I figured I would seek insight tonight and hopefully someone can give me some pointers so that tomorrow can be more productive. Thank you all!
I have created an xlsm file that contains two worksheets. One of them is a locked down form that contains a list of options and pricing for our dealers. the top row is frozen and has a print, save form, email form, and reset button. The problem I am having is with the save form button. I spent almost 4 hours troubleshooting my code today but I still run into errors that I cannot seem to fix, and it doesn't really work the way I was hoping. I'm really hoping someone can give me a fresh idea on this code. Here's what I would like to happen When the button is clicked:
1. The user clicks save form button.
2. A save as dialog box pops up, defaulting to the directory the master xlsm template is in (the current directory)
3. User is only able to save as xlsm extension
4. A field on the form, J8, contains a PO number. I would like the new filename in the save as dialog field to display "existing filename PO_("J8").xlsm" or, in order to differentiate the file name if a PO is not entered, append the current date instead of the PO.
5. What I was doing was replacing the string " PO_.xlsm" with ".xlsm" to remove the PO label from the filename if they didn't enter anything in J8
6. When/if they click cancel instead of save on the dialogue box, the box should close without error :P (my major issue today) and if they click save, then the file is saved as the new name, plus the PO. If a PO is not entered, then save with the current date appended.
7. After the new file is saved, the original is left untouched/unsaved
I am sorry I don't have the code I used at the moment. It's at work, and I figured I would seek insight tonight and hopefully someone can give me some pointers so that tomorrow can be more productive. Thank you all!