Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change excel cell datatype! 1

Status
Not open for further replies.

wendywam

Programmer
Jun 21, 2004
15
ZA
Hi
I have a number like this: 08312345678
When I enter that number in excel cell, the zero is removed.
I can format the excel cell not to discard the zero using the Excel application.
I want to do the same thing programatically with visual basic.
How do I do that?
If I want to format a cell to general type, I do this
range.numberformat = "General"
How do you do the same with Text type?
 
When using the macro recorder, it gives:
[tt]selection.numberformat = "@"[/tt]

I often keep banging my head against tha wall for a while, until I remember the recorder;-)

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top