+ Reply to Thread
Results 1 to 11 of 11

extend conditional format

  1. #1
    Registered User
    Join Date
    10-19-2005
    Posts
    48

    extend conditional format

    Hi There,
    I have seen some posts on sophisticated extension of conditional formatting but those only took care of colors. what I would like to have is:

    if cond1
    -specify color
    -specify bold or not
    -specify italic or not
    -specify cell color
    -specify cell (not content) underline

    if cond2, etc..

    anyone?

    thanks a lot,
    jm

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Something like

    Uses the select case. If you enter one of the two conditions in Col A it changes cell font and interior colours etc

    Code goes in the worksheet

    http://www.contextures.com/xlvba01.html#Worksheet

    http://www.ozgrid.com/VBA/select-case.htm

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    10-19-2005
    Posts
    48
    Thank you VBA Noob,

    sorry for those neewbie VBA add'l questions::

    - how is th sub called? do I need to run a macro? can this be applied automatically?
    - How if I want to do the CASE on column A, and apply changes on columns B to D?
    - what is the code to underline the cell border (vs. content)?

    thx again,
    jm

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    - how is th sub called? do I need to run a macro? can this be applied automatically?
    Read link. Explained there

    - How if I want to do the CASE on column A, and apply changes on columns B to D?

    Change "A:A" to "A:C" to work with Column A to C
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

    VBA Noob

  5. #5
    Registered User
    Join Date
    10-19-2005
    Posts
    48

    Red face

    cool, getting there. Works great on the cell I ENTER a value on.

    I would need however :

    1: depending on what cell in Col A is, will change format in Cols B-D

    2: should do this based on e.g. A1 which is a formula, i.e. I am not actually changing or entering anyting on A1. But depending on many other cells, A1 will have a value which I use to format B1 C1 and D1.

    thx,
    jm

    PS: what is the code to remove the border?

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Remove borders
    Please Login or Register  to view this content.
    Use offset to change Col B formatting

    e.g
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    VBA Noob
    Last edited by VBA Noob; 06-16-2007 at 01:54 PM.

  7. #7
    Registered User
    Join Date
    10-19-2005
    Posts
    48
    Noob,

    - Offset(0,n) takes care of one offset cell. how about doing it on several columns? (will change C AND D)?

    - There is still a major difference with the regular "conditional formatting". The sheet I work on is purely a sheet of formulas based on other sheets. I am not typing anything into this sheet, but I need it to reformat itself. The code seems not to be able to do so. Maybe _change is not the right trigger? _Calculate maybe?

    thx,
    jm

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Why don't you just give us a clue what your trying to do by posting an example instead of these cryptic clues

    e.g How many conditions, What cells trigger what condition


    VBA Noob

  9. #9
    Registered User
    Join Date
    10-19-2005
    Posts
    48
    here you go:

    1. I am pasting the whole "data" worksheet with value from another XL workbook.
    2. The "display" worksheet compiles info from "data" worksheet
    2.1 One of the compilation is column A, which defines a type of format
    2.1. Based on this format, I need to format columns B, C and D

    Hope this is not too cryptic,
    thx for your help,
    jm
    Attached Files Attached Files

  10. #10
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Place this code in the display sheet

    Please Login or Register  to view this content.

    then enter the below in a module. Everytime you select the sheet it will update

    Please Login or Register  to view this content.
    VBA Noob

  11. #11
    Registered User
    Join Date
    10-19-2005
    Posts
    48

    Thumbs up

    thanks a lot, works perfectly.
    best regards,
    jm

+ 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