+ Reply to Thread
Results 1 to 5 of 5

Selection of one specific cell OR another.

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Selection of one specific cell OR another.

    I use this code to change the colour of the text in E11 if A1 is selected :


    Please Login or Register  to view this content.

    It works fine , but I'd like to expand it so that it includes selection of G3. So that if either A1 or G3 are selected then change the colour in E11. Can someone suggest some code to satisfy this?

    I've tried various methods but my syntax is letting me down! Everything I've tried so far gives errors or fails to work.


  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,523

    Re: Selection of one specific cell OR another.

    Please Login or Register  to view this content.
    This would be easier to expand if you want
    Please Login or Register  to view this content.
    Last edited by jolivanes; 02-18-2020 at 02:13 AM. Reason: Additional info added

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool

    Just with a single codeline :

    [E11].Font.Color = IIf(InStr("$A$1$G$3", ActiveCell.Address), 16777215, 9109504)

    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  4. #4
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Selection of one specific cell OR another.

    OK thanks. It's working fine now. Problem solved.



  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,523

    Re: Selection of one specific cell OR another.

    Thank you for letting us know.
    Good luck

+ 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. List selection returns specific cell contents in selected cell.
    By threeninethree in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-15-2014, 05:54 PM
  2. [SOLVED] auto populate cell data based on specific selection in another cell
    By tinka590 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-07-2013, 02:37 AM
  3. Replies: 3
    Last Post: 09-20-2012, 03:11 PM
  4. based on selection in a combobox I need the corespoding value in a specific cell
    By iscar_marius in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2009, 02:49 AM
  5. Replies: 3
    Last Post: 05-29-2007, 04:07 AM
  6. Lock data in a cell a specific cell based on selection on other ce
    By CrimsonPlague29 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-10-2006, 06:10 AM
  7. [SOLVED] Setting a specific cell selection to manual
    By Serge in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-26-2006, 08:25 PM
  8. Select specific columns for a given cell selection
    By crazybass2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2005, 01:06 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