Hi born2dive
In your last attached file in post#21, look at your heading row 3 on sheet [Master Data list], columns [M] to [BA]
..what are they for???
..I removed them in the version v3a file attached.
Instead of removing the [Step 1] button, you could just call the Step1 routine at the start of the Step2 routine.
Putting..
step1
..as the first line of code in the Step2 routine achieves what you wanted i.e. always clearing before merging.
By keeping the [Step 1] button, you can now halve the file-size by clearing the data before saving your file.
TIP:
if you want to reduce the filesize even more, just save your Excel files as .xlsb filetype (my favourite).
Smaller-sized files are faster to load and reduce network traffic. Just saying.
Can we remove the data in Column A as I need this blank
Yes, this was a simple job: just commented-out those lines of code.
To simplify which datasheets get processed, i.e. merged into the [Master Data list], you could have a simple rule, like, "if the sheet tabname starts with a space, don't process this sheet"
So, I changed the code to implement this example rule. Any sheet you don't want included in the merg, just add a space prefix to the start of the sheet tabname e.g rename [FEMA #] as [ FEMA #], and rename [Sheet4] as [ Sheet4] etc etc etc.
It is a lot simpler than having a pop-up and writing more code.
Unless you forget the rule of course. In which case, add a note on the main sheet.
You could use a different simple rule, for example, "don't merge any sheets if the sheet tabname colour is, say, black."
Regarding the 'blank lines from the Personal Data list'.
This is due to the method used of finding the last row. One common method is the [End] [Up]method. If you start at the bottom of a column, and press keys [End] [Up], it will 'stop' in the first non-blank cell it encounters. However, when you are using Tables, e.g. on your sheet [Personal Database], if you scroll-down and put the cellpointer in say, cell [B510], when you press [End] [Up] it will stop in cell [B500]. Although this is an 'empty' cell, it is actually part of your data Table (it is a 'blank' data-record). It is part of your 'used-range'
So I have changed the code to use a different method of finding the last row:
I hope the attached v3a updated file helps with what you need.
If it does, then this help would be valuable. If not, then this help is invaluable.
zeddy
Excel Coding Team Rehabilitation Volunteer Therapist
Bookmarks