save file as worksheet tab name

Trevor3007

Well-known Member
Joined
Jan 26, 2017
Messages
667
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have heard that it is possible to save a Excel workbook as the tab name & to a specific location ( example c:\data\testme\ . xls or *.xlsm) If this is possible,

can the coder please include a 'message/ input box' to give the option to save as either

if not MACRO workbook
= c:\testdata\workbook\*.xls
If macro
= c:\testdata\workbook\macro\*.xlsm
If Both
= c:\testdata\workbook\*.xls
and
= c:\testdata\workbook\macro\*.xlsm

If not to save
Stop

Hoping this makes sense and I thank you all , but especially the person or persons who takes steps up to the challenge.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
You can get the name of the ActiveSheet like this:
VBA Code:
myName = ActiveSheet.Name
So you can incorporate that into your file name.

A bunch of questions regarding saving the file.
- Are you looking just to save the current tab?
- Are there multiple tabs?
- Do you want the option of saving the VBA along with it (meaning if they choose no, then you need to save a copy without the VBA code)?
- If you want them to save with VBA code, do you just want to include all the existing VBA code in the workbook?
- Regarding saving your file, you should now save non-VBA workbooks as "xlsx" and not using the old "xls" extension (as "xls" extensions actually do allow VBA).
 
Upvote 0
Hello Joe4,

Many thanks for your help. Please see below A's to your Q's



Are you looking just to save the current tab?
There a few tabs , but where I am will place the VBA , that tab's name will be the name for the file.
This particular tab name will change slightly each week , as the file has to have XXX_WE270621, XXX_WE040721 etc.



- Are there multiple tabs?
Yes there are a few tabs , but as in answer above to the above, the file will be saved as the the tab name

- Do you want the option of saving the VBA along with it (meaning if they choose no, then you need to save a copy without the VBA code)?
Need to save 2 copies, one that contains the VBA & one that does not.
Reason for this as the none VBA will be uploaded to Teams.


- If you want them to save with VBA code, do you just want to include all the existing VBA code in the workbook?
Yes , all the code in all the tabs
- Regarding saving your file, you should now save non-VBA workbooks as "xlsx" and not using the old "xls" extension (as "xls" extensions actually do allow VBA). Okay , thanks for the tip. Please use the applicable extension(s) moving forward.

Thank you & much appreciate your help.
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,937
Members
449,094
Latest member
teemeren

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