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!

Setting Excel Number format

Status
Not open for further replies.

drkestrel

MIS
Sep 25, 2000
439
GB
Anyone know what's wrong with the following code??

Code:
xlSheet.Range("C5").NumberFormat = "Text"
where xlSheet is an Microsoft Excel Worksheet object

setting other Range object to things like "dd mmm yyyy" does work!

running the above code, however, generates error in 'can't set numberformat to range object!!

 
If you want to format the cell as a Text field;

.NumberFormat = "@"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top