Consulting

Results 1 to 3 of 3

Thread: Solved: Accounting format

  1. #1
    VBAX Tutor
    Joined
    Dec 2006
    Posts
    271
    Location

    Solved: Accounting format

    How do I format a column in a list view to display the value in accounting format

    I used the macro recorder and got this:

    [vba]Selection.NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"[/vba]
    But when I transfer that to my code:

    [vba].ListItems(i).ListSubItems.add , , Format(total, "? #,##00.00")[/vba]

    to
    [vba].ListItems(i).ListSubItems.add , , Format(total, "_(?* #,##0.00_);_(?* (#,##0.00);_(?* ""-""??_);_(@_)")
    [/vba]

    It doesn't give the desired result

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Some formats are not supported by VBAs Format method. Try Application.Text as an alternative.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Dec 2006
    Posts
    271
    Location
    Thanks XLD
    Took the simpler approach and added a column that just hold the ? sign

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •