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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

format column in Excel through vb?

Status
Not open for further replies.

butchkmd

Programmer
Nov 13, 2001
83
0
0
US
I need to change the format of a column in excel to "number" from "general" and have had no luck getting it to work. Below is the code.
Any suggestions?


sht.Range("d:d").ColumnWidth = 15
sht.Range("D3").Value = "CLAIM #"
sht.Range("D3").Font.Bold = True
sht.Range("D3").Font.Size = 11
sht.Range("D:D").FormatConditions.NumberFormat = "Number"
 
You might want to try actually setting the .NumberFormat property to a display mask.

.NumberFormat = "###,###"

Also, it looks like you want to set this format for the entire column, so you might want to try

sht.Columns("D").NumberFormat = "###" Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top