I found this neat piece of code and it does what I want: Export based on Values in a specific value in a column.
I inspected the code and this line here is responsible for generating the file name:
THE PROBLEM is this: Sometimes the value in the column which gets expoerted after which the file name is created, has an illegal character that cannot be in a windows file path, like / or :![]()
Please Login or Register to view this content.
I know I could replace the values in the column with other characters such as "-", however, the problem is that this column is also used in a VLOOKUP-Formula, and if I change the value in it, VLOOKUP cannot find the corresponding values.
So my current workaround is to create another column in which I remove the illegal characters, export the files and delete the column afterwards, but this is awkward.
Is there a way to have the export-skript omit or replace these illegal characters right in th VBA Code?
Thanks!
Bookmarks