Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert 5 characters in a cell to 6 characters by adding a zero Helenf Excel Discussion (Misc queries) 4 May 18th 09 04:43 PM
Insert Leading Characters If String Is Only 7 Characters Paperback Writer Excel Discussion (Misc queries) 2 April 21st 09 09:07 PM
Retrieving Data: Speed of beating down rows vs retrieving from array? (PeteCresswell) Excel Programming 2 July 9th 07 03:30 PM
How do I keep a running total of pounds lost and percentage lost angel5959 Excel Discussion (Misc queries) 4 January 26th 06 09:18 PM
In Excel find characters when multiple characters exist w/i a cel teacher-deburg Excel Worksheet Functions 1 December 5th 05 10:22 PM


All times are GMT +1. The time now is 07:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"