+ Reply to Thread
Results 1 to 4 of 4

Excel VBA ListView format to display Decimal values with comma

  1. #1
    Registered User
    Join Date
    01-17-2017
    Location
    London
    MS-Off Ver
    2016
    Posts
    7

    Excel VBA ListView format to display Decimal values with comma

    Hello,

    Hope you can assist with solving this:

    I would like to make the Price column in the ListView display the values with the 3 digit comma separation and ending with 2 decimal places (#,###.00)

    I had tried many ways that I found online, but due to the format in which my code add the items in the listView, I am unable to figure out how to achieve this.

    Thanks a lot


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Excel VBA ListView format to display Decimal values with comma

    Either use the cell TEXT property to add the formatted displayed value from the cell or else use use the FORMAT function for each individual Subitem you want to format.

  3. #3
    Registered User
    Join Date
    01-17-2017
    Location
    London
    MS-Off Ver
    2016
    Posts
    7

    Re: Excel VBA ListView format to display Decimal values with comma

    Thanks for your reply cytop,

    Could you please clarify no how to go about doing it with ref to my code?

    I tried using the following code as FORMAT function for each Subitem but couldn't get it to work:

    ListView1.ListItems.SubItems(4) = Format(Expression, "#,###,##0")

    Please advice.

    Thanks

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Excel VBA ListView format to display Decimal values with comma

    You have to format each subitem as it is added to the ListView, probably in the 'For Lngsub...' loop. Using a phone so not really going to try and write code.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Decimal places as comma format
    By dan789 in forum Excel General
    Replies: 4
    Last Post: 11-17-2015, 09:35 AM
  2. [SOLVED] Excel: Display combobox as listview subitem
    By ChrisVBA in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-07-2014, 10:03 AM
  3. [SOLVED] Using VBA, how to display decimal seconds using format and now functions?
    By NeuroSpace in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2014, 12:51 PM
  4. Format display decimal values but no decimal point
    By BecParko in forum Excel General
    Replies: 1
    Last Post: 10-18-2007, 04:42 AM
  5. Display value in textbox format decimal places
    By alex3867 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2007, 07:20 AM
  6. Replies: 3
    Last Post: 07-05-2006, 01:57 PM
  7. [SOLVED] Format a cell to display decimal hours.
    By Fred Holmes in forum Excel General
    Replies: 2
    Last Post: 03-18-2005, 12:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1