ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Column format as Text (https://www.excelbanter.com/excel-programming/291354-column-format-text.html)

Bruce Roberson[_5_]

Column format as Text
 
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?


Tom Ogilvy

Column format as Text
 
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.

--
Regards,
Tom Ogilvy


"Bruce Roberson" wrote in message
...
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?




No Name

Column format as Text
 
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.


-----Original Message-----
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.

--
Regards,
Tom Ogilvy


"Bruce Roberson"

wrote in message
...
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?



.


Tom Ogilvy

Column format as Text
 
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.

--
Regards,
Tom Ogilvy

wrote in message
...
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.


-----Original Message-----
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.

--
Regards,
Tom Ogilvy


"Bruce Roberson"

wrote in message
...
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?



.





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com