disable formatting

  • Thread starter Thread starter Eph0nk
  • Start date Start date
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
 
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.
 
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?
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top