Computing.Net > Forums > Office Software > Type of column in EXCEL

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Type of column in EXCEL

Reply to Message Icon

Name: JanoPano
Date: January 22, 2004 at 00:30:05 Pacific
OS: WINDOWS
CPU/Ram: celeron 850, 512MB
Comment:

Hello,
how to set the type (text, number, date,..) of column in EXCEL with VBA? (not manually through Ctrl+1 -> Format of Cells ->...)
Thanks for your willingness.



Sponsored Link
Ads by Google

Response Number 1
Name: dtech10
Date: January 22, 2004 at 08:15:09 Pacific
Reply:

Hi Jano
The best way to find out what code you require is the create a macro and look at the code produced. ie.

Goto Tools>Macro>Record New Macro.
Click Ok
Format your cells as normal using the Format>Cells>???? ie.Ctrl+1
When done select Tools>Macro>Stop Recording.
Select Tools>Visual Basic Editor and look at the code produced.

example.
This recorded the Currency macro which produced the folling code.

Range.("A1:A10").Select
Selection.NumberFormat="$#,##0.00"

This can be shorted to
Range.("A1:A10").NumberFormat="$#,##0.00"

Hope this helps.


0

Response Number 2
Name: charlie1130s
Date: January 22, 2004 at 08:17:50 Pacific
Reply:

If you want to change it to number

Range("a3").NumberFormat = "0.00"


0

Response Number 3
Name: JanoPano
Date: January 22, 2004 at 23:19:11 Pacific
Reply:

Thanks for both.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Type of column in EXCEL

compare two columns in excel www.computing.net/answers/office/compare-two-columns-in-excel/7968.html

compare two columns in excel 2007 www.computing.net/answers/office/compare-two-columns-in-excel-2007/8119.html

increase no of rows in excel shet www.computing.net/answers/office/increase-no-of-rows-in-excel-shet/8272.html