disable formatting

E

Eph0nk

Hi,

I wrote an excel/html output from a database, but when it gets imported, the
housenumbers that are formatted like "9/13" or "13-17" get formatted as a
date.
Is there a way to turn this of, or to make sure this doesn't happen?

Regards
Tim De Vogel
S-Data NV
 
K

K Dales

Answer would depend on the exact method you are using to
import it (Text file? External data query via ODBC? VBA
routine?) However, it might just be simpler to set up a
routine to format that column as text after the import -
it will force Excel to read treat your housenumbers as
text.
 
E

Eph0nk

I don't import it, I export to the html/excel format that microsoft supports
(where each cell in a table of html is viewed as a cell in excel). It has
the extension .XLS and excel opens it just like it would open up a normal
excel file.
Is there a place where you can point me at that has some info on such a
routine?
 
K

K Dales

The VBA code would be:
Sheets(SheetName).Range(RangeName).NumberFormat="@"

Where SheetName is the name of the worksheet and RangeName
is the name (or address) of the range including your
housenumbers - example:
Sheets("Import").Range("C:C").NumberFormat = "@"
You could set this up as a macro.
 
Top