VBA code to save selected sheets to a new workbook

JonasTiger

New Member
Joined
Jan 28, 2022
Messages
24
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi
I found this thread
vba code to save selected sheets as new file
That works fine and fast to create a new WB from selected sheets in an existing WB

The changes I need to do is:
  • available to choose the sheets (not the the last 3 that the code fits) - I need to select 6 random sheets (i.e, "Sheet1", "abb", "Sheet4", ...)
  • not display zeros in allsheets in the new WB
  • Filter all sheets in the new WB, based on values of a specific column
Thanks in advance
JT
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Are the zeros results of formulae or are they manually entered? Are the zeros in specific column or columns? Which column do you want to filter and what is the filter criteria?
 
Upvote 0
Are the zeros results of formulae or are they manually entered? Are the zeros in specific column or columns? Which column do you want to filter and what is the filter criteria?
Zeros may exist in all columns because they're result of formulae
Filter is for col AB (col 28) and the criteria is "Confirmed", "Rejected", "Waiting", by this order, if possible
 
Upvote 0
With regards to the formulae, you could probably revise each formula to result in a blank instead of a zero. Is that possible? When you copy the sheets, do you want to formulae copied or just the values without the formulae?
 
Upvote 0
With regards to the formulae, you could probably revise each formula to result in a blank instead of a zero. Is that possible? When you copy the sheets, do you want to formulae copied or just the values without the formulae?
Hi
Just the values and formats, the code already does that
In formulae, which is almost Index Match, it includes iferror to result blanks
 
Upvote 0
Results in blanks come from iferror statement:
=IFERROR(INDEX(range),MATCH(cell,Range,0)),""), for example
How to turn result on blank if it is real zero?
 
Upvote 0
Could you use the XL2BB add-in (icon in the menu) to attach a screenshot (not a picture) of one of your sheets. Select the option in the addon to include the sheet formulae.
Alternately, you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing'
and you will be given a link to the file that you can post here. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary).
 
Upvote 0
I have something for you that works on a dummy file. What works on a dummy very often doesn't work on the actual file. The screen shot I requested will allow me to test the macro on your file.
 
Upvote 0
I have something for you that works on a dummy file. What works on a dummy very often doesn't work on the actual file. The screen shot I requested will allow me to test the macro on your file.
I'm trying to figure out how to do that, because its very sensitive data
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,602
Members
449,089
Latest member
Motoracer88

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