+ Reply to Thread
Results 1 to 3 of 3

Cannot use Custom Number Format. Need help with a VBA code

  1. #1
    Registered User
    Join Date
    02-21-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    19

    Cannot use Custom Number Format. Need help with a VBA code

    I created a pivot table and using data from the sites tab (see attached file). In order to transfer the business hours access info over to the pivot table (sheet 1), I created a Legend column (columns B & C) 1=Full, 2=Ltd, 3=full. Under the values, I customized the number format to [=1]"Full";[=2]"Ltd";"None". Here’s the problem I have to add 4=NS; 5=Closed. Unfortunately custom number format only allows 3 changes. The only alternative I see is to use a vba code. Can anyone help me?

    I’m a novice to vba. I tried this for Sheet 1 but it got me nowhere.

    Please Login or Register  to view this content.
    I also need to do the same for column C.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Cannot use Custom Number Format. Need help with a VBA code

    Why don't you use simple if conditions in the cell to achieve your grouping logic.

    Please Login or Register  to view this content.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,466

    Re: Cannot use Custom Number Format. Need help with a VBA code

    Maybe:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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 a VB Code for Pivot Table instead of using custom format code
    By Linus100 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-02-2014, 01:13 PM
  2. Custom number format code for hiding specific values on chart axes
    By rob_storrar in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 11-25-2012, 12:27 AM
  3. 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
  4. 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
  5. 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