Excel Formatting in VB6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dawn123
    New Member
    • Nov 2009
    • 15

    Excel Formatting in VB6

    I am making a program that will write what the user input to Excel and I was wondering how to format a number so it only has two deciamal places in excel and so its also bold.. This is what i have for code but it doesn't seem to be working. Any help would be great. Thanks in advanced.

    ApExcel.Cells(2 , 1).NumberFormat = "0.00"
    I also tried it with "############.# #"
    but nothing works.
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    dear,

    It works with=

    Sub Macro1()
    Cells(2, 1).NumberFormat = "0.00"
    End Sub

    Sub Macro2()
    Cells(3, 1).NumberFormat = "############.# #"
    End Sub


    br,

    Comment

    Working...