+ Reply to Thread
Results 1 to 5 of 5

Conditional formatting based on selected cell

  1. #1
    Registered User
    Join Date
    01-12-2015
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    20

    Conditional formatting based on selected cell

    Hi

    I have looked around for a couple of days with no real solution to this. I am trying to highlight all cells in alternating columns (B, D, F etc) that match a cell when clicked.

    I have managed to get it to work in the same column where the cell is clicked, but not all columns (or preferably the alternate columns).

    I am using the following as the conditional format formula
    =IF(CELL("col")=COLUMN(B2:B12),B2=CELL("contents"),FALSE)

    And I use
    Target.Calculate in the code for the sheet.

    Can anybody see where I am going wrong and show matches in all columns (B, D, F)? Any help is greatly appreciated.

    Thanks
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Kamboj's Avatar
    Join Date
    09-25-2014
    Location
    India
    MS-Off Ver
    2003 - 2010
    Posts
    430

    Re: Conditional formatting based on selected cell

    I removed conditional formatting and make code under worksheet selection change
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Kamboj
    _________________________________________________________________________________
    Mark the thread as SOLVED if my answer satisfy you.

  3. #3
    Registered User
    Join Date
    01-12-2015
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    20

    Re: Conditional formatting based on selected cell

    This seems to work great but how would I be able to include only every other column (in this case the Prod. column) other than explicitly defining the ranges?

    Thanks so much

  4. #4
    Valued Forum Contributor Kamboj's Avatar
    Join Date
    09-25-2014
    Location
    India
    MS-Off Ver
    2003 - 2010
    Posts
    430

    Re: Conditional formatting based on selected cell

    for that you have to change this line
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-12-2015
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    20

    Re: Conditional formatting based on selected cell

    Hello again. I guess I am looking for a way to apply this to specific rows in every 2nd column, like:

    Rows 5:10 and 12:15 in every 2nd column, starting at A for about 50 columns.

    Is this possible with a For Loop?

    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. Conditional formatting / VBA, based on selected time range
    By russkris in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-01-2013, 07:45 PM
  2. Replies: 5
    Last Post: 11-27-2013, 06:04 PM
  3. [SOLVED] Conditional Formatting based on another cell
    By Blade Fisher in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-28-2013, 08:33 AM
  4. Conditional Formatting via VBA: Change formatting in range based on value of each cell
    By ralphjmedia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2013, 10:37 AM
  5. Conditional formatting based on value in another cell
    By KevBotes in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-19-2012, 12:20 PM
  6. Replies: 4
    Last Post: 01-06-2012, 05:07 PM
  7. Replies: 1
    Last Post: 03-22-2006, 10:48 AM

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