View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
deluth deluth is offline
external usenet poster
 
Posts: 6
Default Need to set Column format as text

Hi Norman,

Thank you for the quick response. Unfortunately, this method did not work
for me. I set the format as you suggested: ...NumberFormat = "@" in the
beginning of the subroutine. In the middle, I set the cell value as so:
destCell.Value = srcCell.Value
Some of srcCell.Value are text, but most are numbers, but I wanted the
entire column to be represented as text. The resulting value for the cells
with numbers were in numbers. For example, a value of "2200505000099" became
"2.20051E+12"

Should I have done a string conversion? If so, how do I know when the cell
value starts with a text and when it starts with a number? Do I need to test
the cell value for numeric and then convert? There must be an easy way to do
this...

Any help would greatly be appreciated!

"Norman Jones" wrote:

Hi Deluth,

Try:

ActiveSheet.Columns("A:A").NumberFormat = "@"

Another question is if I do set the format correctly to text, would all
the
data values being entered be converted to text automatically? Even if the
data is a numeric value?


Yes.

---
Regards,
Norman



"deluth" wrote in message
...
I am converting a spreadsheet from one format to another. I am having
trouble with setting the format of one of the column to 'text'. I tried
worksheet.Column.NumberFormat = "Text" with no luck. The value of
NumberFormat in the Watch window still shows up as "Null" and the column
still did not format correctly - numeric value still shows up as
numbers...

Another question is if I do set the format correctly to text, would all
the
data values being entered be converted to text automatically? Even if the
data is a numeric value?

Appreciate any help that can be given.

Deluth