Hi
Sorry if this has long since been discussed and solved, but sadly in searching this and other forums and the web, I can't find a solution! doh! Must be blind?
I guess the fact I'm in the UK might be relevant to code pages etc.
I'm reading in (well cut and pasting from a text file that is generated by a dos piped dir command) a list of file names that include £, $ and € currency symbols within the file name.
an example line might be "c:\test dir\value_€12.23.pdf". ie that is one cell when pasted to excel.
The $ symbol are fine as the text file and excel retain the symbol with no hassle
The £ symbol becomes œ (char 156) when loaded into the text editor (Notepad++), so when I paste into excel I can use "substitute" to convert to char 163, to correct this.
The € symbol becomes a standard ? (char 63) so this can be changed to char 128 and as "?" is not used in the file names elsewhere, there is no chance of extra € appearing!
So the DOS to Textfile to EXCEL can be corrected with this:
Reading the file in is fine, but then I need to write it back - that's the issue!
It will become a batch file of rename commands (yes, I could write some VBA rather than creating a batch file, but this is a quick and dirty project - or was quick till I hit this brick wall !)
My destination Cell might be:
REN "c:\test dir\value_€12.23.pdf" "value_paid_€11.95.pdf"
and this cut and past into a batch file looks fine too, but once run the filename in windows/dos no longer has the "€" but something else ! The same is true for teh £ symbol, but that I can fix by swapping back to the char 156, either by using Substitue or formating the value field
This works great for £, but ...
Sadly the EURO (€) cannot be written as char 63 "?", and I have tried char 250 and char 128, but neither work ...
It's not the excel display that I have an issue with but the writing back into a format that I can use in a DOS batch file to create a € within the file name.
Is there a char that will work, if not can this be done in VBA, if so what char should I use?
Everything else is fine, just the pesky EURO! ... and no I'm not joining UKIP to avoid the issue
thanks in advance
thanks
Richard
Sorry if this has long since been discussed and solved, but sadly in searching this and other forums and the web, I can't find a solution! doh! Must be blind?
I guess the fact I'm in the UK might be relevant to code pages etc.
I'm reading in (well cut and pasting from a text file that is generated by a dos piped dir command) a list of file names that include £, $ and € currency symbols within the file name.
an example line might be "c:\test dir\value_€12.23.pdf". ie that is one cell when pasted to excel.
The $ symbol are fine as the text file and excel retain the symbol with no hassle
The £ symbol becomes œ (char 156) when loaded into the text editor (Notepad++), so when I paste into excel I can use "substitute" to convert to char 163, to correct this.
The € symbol becomes a standard ? (char 63) so this can be changed to char 128 and as "?" is not used in the file names elsewhere, there is no chance of extra € appearing!
So the DOS to Textfile to EXCEL can be corrected with this:
Code:
SUBSTITUTE(SUBSTITUTE(C2,char(156),CHAR(163)),CHAR(63),CHAR(128))
Reading the file in is fine, but then I need to write it back - that's the issue!
It will become a batch file of rename commands (yes, I could write some VBA rather than creating a batch file, but this is a quick and dirty project - or was quick till I hit this brick wall !)
My destination Cell might be:
REN "c:\test dir\value_€12.23.pdf" "value_paid_€11.95.pdf"
and this cut and past into a batch file looks fine too, but once run the filename in windows/dos no longer has the "€" but something else ! The same is true for teh £ symbol, but that I can fix by swapping back to the char 156, either by using Substitue or formating the value field
Code:
TEXT(VALUE(AO2),CHAR(156)&"0.00")
Sadly the EURO (€) cannot be written as char 63 "?", and I have tried char 250 and char 128, but neither work ...
It's not the excel display that I have an issue with but the writing back into a format that I can use in a DOS batch file to create a € within the file name.
Is there a char that will work, if not can this be done in VBA, if so what char should I use?
Everything else is fine, just the pesky EURO! ... and no I'm not joining UKIP to avoid the issue
thanks in advance
thanks
Richard