Intro:
I'm writing a VBA macro which imports data from a source, then modifies it in the MS Excel file before putting it in the right order in the first sheet called WegschrijfSheet
. This sheet is then copied to a new MS Excel file before the first sheet from this file. (This part works fine.)
Main Question:
Now I'd like to save this file as a CSV. My code does this but not yet in the way I would like it to. Text and/or values which first were in A1, B1, C1, H1 etc. are merged into Cell A1. It does this for all the rows. Empty rows are filled with ,
signs. Example of the result:
Productieorder,228767,,,,,,,,,,
Artikelnummer,4022 631 79951,,,,,,,,,,
Bewerkingsnummer,14,,,,,,,,,,
Bewerkingsrevisie,1,,,,,,,,,Bestandslocatie ophalen :,Z:\Parts Manufacturing\5. Kwaliteit\130 - in proces meten\macro voor oude excel bestanden omzetten\Testbestanden
(At each ,
it should jump to the next cell.)
One way to solve this would be changing my PC settings from European to American. Where .
is the decimal delimiter and vice versa, but ending up with values for which the decimals are defined by a .
would make me unable to use the files for software I use to analyse the data.
Could I somehow use another delimiter than ,
to solve this?
I know how to select another delimiter manually but have no clue how to do this in VBA. Or better still, is there another solution?
(P.S. this macro has to convert over at least 600 MS Excel files, and counting. So converting all files manually is not an option.)
Here is my code :
ActiveWorkbook.SaveAs FileName:= _
"Z:\Parts Manufacturing\5. Kwaliteit\130 - in proces meten\macro voor oude excel bestanden omzetten\Wegschrijflocatie\4022 631 79951#14#" & Sheet1.Range("B1").Value & ".csv", _
Fileformat:=xlCSV, CreateBackup:=False