+ Reply to Thread
Results 1 to 2 of 2

VBA Conditional Formating

  1. #1
    Registered User
    Join Date
    11-14-2007
    Posts
    4

    Arrow VBA Conditional Formating

    Hello,

    So I attached an example of what I am wanting.

    I have a chart of numbers that I would like to have formatted as either:
    (1) Currenty with no decimals and a dollar sign -or-
    (2) Percentage with no decimals

    I want the range to be formated based on the contents of one cell (B2). If cell B2=1, then I want format (1) above, if B2=2 then I want format 2 above. Unless I am missing something, the normal Format > Conditional Formatting.. options will not change the type of cell format I am wanting.

    I am a very green VBA noob so if anyone could help me out with this as simply as possible it would be much appreciated.


    EDIT: Also, its my understanding that the sheet won't automatically update using the Forms Drop-Down-Box. I'm not sure how to use the VBA one...
    Attached Files Attached Files
    Last edited by dissonance; 03-09-2009 at 01:23 PM.

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: VBA Conditional Formating

    dissonance,

    Using the "Worksheet_Calculate" Event, see the attached workbook "Worksheet_Calculate Event - dissonance-Example - dissonance - SDG.xls".


    Your yellow text:
    Format (C33:G37) to:
    - Currency with 0 decimals if B2=1
    - Percent with 0 decimals if B2=2"

    I think, should be Range("C30:G34").


    Have a great day,
    Stan
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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