Column format as Text

  • Thread starter Thread starter Bruce Roberson
  • Start date Start date
B

Bruce Roberson

I recorded a macro that I thought would format column f as
text, and it records as shown below:

Columns("F:F").NumberFormat = "@"

It works for several columns, but it doesn't work in this
particular column. If you get in a cell beside it and
issue the following formula:

=istext(f2); the result is false, telling you that the
result is not text.

What can I do to change this to make it be text instead of
numeric?
 
ISTEXT won't return true just because the cell is formatted as text. It
only will return true if you have a value in the cell. If you put a value in
the cell, then since it was preformatted as text, the value will be stored
as text and the function will return true.
 
I was doing the istext to confirm the fact that it truly
wasn't text. When I did a file, save as xyz.dbf (for
database), then when I tried to append to a database file
that depended on that column F being a text field, the
append operation did not accept it because the column was
numeric rather than text. So the questions remains:

Is their another way to make this column of numeric values
convert to text ?

I could probably write a loop that would go to each cell,
and put an ' (apostrophe) in front of the numbers and that
would undoubtedly do it. However, I was just looking for a
better alternative since this column must be a text field
when appending to this database I am using.
 
If you put in a dummy row with AAAA in the cell for that column, it will be
text. That always works for me when I am saving as DBF.
 
Back
Top