Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving the characters lost
Hello everybody.
When I convert a txtfile into xlsfile, a cell that must contain the text "- John" (ignore quotation marks) become a formula "=- John" (ignore quotation marks). In the worksheet, Excel displays the value "#Name?" (ignore quotation marks) at that cell and displays "=- John" (ignore quotation marks) at the edition bar. Using VBA, how can I get back the original characters "- John" ? Thank you in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving the characters lost
When you say you are converting a text file to an xl file do you mean that
you are importing the text file. If so, what type of text file? Is it a .csv file or a .txt file? Now you say you want the VBA code but first:- If it is a .txt file then in the Text to columns dialog box you can select the format for specific column and set it as Text and that will probably overcome the problem. If it is a .csv file then the dialog box seems to get bypassed and you don't get the opportunity to set the format for the column. I usually get around this by changing the file name from .csv to .txt in windows explorer. (Need to set your explorer options to display the file extension.) Now for the VBA. You should be able to get the correct VBA syntax for the Text to columns by recording the operation. Hope this helps. -- Regards, OssieMac "Alogon" wrote: Hello everybody. When I convert a txtfile into xlsfile, a cell that must contain the text "- John" (ignore quotation marks) become a formula "=- John" (ignore quotation marks). In the worksheet, Excel displays the value "#Name?" (ignore quotation marks) at that cell and displays "=- John" (ignore quotation marks) at the edition bar. Using VBA, how can I get back the original characters "- John" ? Thank you in advance. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieving the characters lost
Just on target about .txt file, OssieMac.
Very opportune your mention about the .CSV file too. Thank you very much. Regards from Brazil. Nathan "OssieMac" wrote: When you say you are converting a text file to an xl file do you mean that you are importing the text file. If so, what type of text file? Is it a .csv file or a .txt file? Now you say you want the VBA code but first:- If it is a .txt file then in the Text to columns dialog box you can select the format for specific column and set it as Text and that will probably overcome the problem. If it is a .csv file then the dialog box seems to get bypassed and you don't get the opportunity to set the format for the column. I usually get around this by changing the file name from .csv to .txt in windows explorer. (Need to set your explorer options to display the file extension.) Now for the VBA. You should be able to get the correct VBA syntax for the Text to columns by recording the operation. Hope this helps. -- Regards, OssieMac "Alogon" wrote: Hello everybody. When I convert a txtfile into xlsfile, a cell that must contain the text "- John" (ignore quotation marks) become a formula "=- John" (ignore quotation marks). In the worksheet, Excel displays the value "#Name?" (ignore quotation marks) at that cell and displays "=- John" (ignore quotation marks) at the edition bar. Using VBA, how can I get back the original characters "- John" ? Thank you in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
convert 5 characters in a cell to 6 characters by adding a zero | Excel Discussion (Misc queries) | |||
Insert Leading Characters If String Is Only 7 Characters | Excel Discussion (Misc queries) | |||
Retrieving Data: Speed of beating down rows vs retrieving from array? | Excel Programming | |||
How do I keep a running total of pounds lost and percentage lost | Excel Discussion (Misc queries) | |||
In Excel find characters when multiple characters exist w/i a cel | Excel Worksheet Functions |