+ Reply to Thread
Results 1 to 4 of 4

Custom number format in VBA

  1. #1
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Custom number format in VBA

    Hi

    I want to use this number format in VBA

    0" Dr";0" Cr";0;@
    but it gets red (error)

    I tried
    range("A1".).NumberFormat="0" Dr";0" Cr";0;@"
    but still shows in red text

    I also tried this in round brackets

    How can I write this custom numberformat in VBA?

    Best Regards
    Imran Bhatti
    Teach me Excel VBA

  2. #2
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Custom number format in VBA

    Solved with the help of this link

    https://www.mrexcel.com/forum/excel-...er-format.html

  3. #3
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Custom number format in VBA

    Don't forget the recorder:

    Please Login or Register  to view this content.
    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  4. #4
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Custom number format in VBA

    O really the recorder produced the same result...Thanks

+ 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. Need formula or code to convert number(s) from custom format to number format
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-12-2015, 07:44 PM
  2. Custom Number Format
    By dcm123 in forum Excel General
    Replies: 3
    Last Post: 12-28-2011, 03:38 PM
  3. Custom format a number
    By Meher in forum Excel General
    Replies: 2
    Last Post: 08-22-2006, 02:47 PM
  4. custom number format
    By mark kubicki in forum Excel General
    Replies: 1
    Last Post: 08-21-2006, 01:25 PM
  5. how do I add phone number format as a permanent custom format?
    By frustratedagain in forum Excel General
    Replies: 3
    Last Post: 02-03-2006, 11:52 PM
  6. Format a cell with a custom number format
    By Armor in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-29-2006, 07:30 PM
  7. Custom number format always defaults last number to 0.
    By scubadave in forum Excel General
    Replies: 2
    Last Post: 06-15-2005, 06:05 PM

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