+ Reply to Thread
Results 1 to 17 of 17

Highlite active cell

  1. #1
    Registered User
    Join Date
    12-28-2023
    Location
    Antwerp
    MS-Off Ver
    365
    Posts
    19

    Highlite active cell

    Hi all,

    I'm looking for highliting the active cell in a sheet.

    There are so many posts and vba codes I found on the net, and tried them all but I can't get passed conditional formatting telling me it's got a problem with the formula.

    I copy paste all the formulas I could find but none of them seems to work.

    Is there and other way like straight with vba code without conditional formatting ?


    Thx all,

    OD

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,858

    Re: Highlite active cell

    You cannot highlight the active cell with regular conditional formatting, so it will have to be VBA.

    Please provide a sample workbook that your helper can use to set up a script for you.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    12-28-2023
    Location
    Antwerp
    MS-Off Ver
    365
    Posts
    19

    Re: Highlite active cell

    This one gives me an error "wrong formula" ? =AND(COLUMN()=CELL("COL"),ROW()=CELL("ROW"))

    This one does nothing actually
    Please Login or Register  to view this content.
    Last edited by AliGW; 03-24-2024 at 08:29 AM. Reason: Code tags added - please review the forum guidelines.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,858

    Re: Highlite active cell

    For your locale, you'd need a semi-colon, not a comma:

    =AND(COLUMN()=CELL("COL");ROW()=CELL("ROW"))

    There's a spelling error in the code:

    Please Login or Register  to view this content.
    Should be 'address'.

  5. #5
    Registered User
    Join Date
    12-28-2023
    Location
    Antwerp
    MS-Off Ver
    365
    Posts
    19

    Re: Highlite active cell

    Correct, the comma I got from an older code, so I changed it in to a semi-colon and the formula is exepted now.
    For the vba code I copy paste your quote ...

    Still nothing happens, I mean there are no errors in both formatting or vba but, still nothing happens. I can click any cell i want but it stay white.

    I still miss something, or forgot, or just don't know (yet) :-)

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,858

    Re: Highlite active cell

    I highlighted the spelling error in the code - I did not correct it. It should be this:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-28-2023
    Location
    Antwerp
    MS-Off Ver
    365
    Posts
    19

    Re: Highlite active cell

    Ohhh I see, sorry lol, It's the age and the eyes, plus English is not my native language, some words I go over it too fast, specially when ADDRESS is spelled ADRES in Dutch ;-)

    But any how, still not working.

  8. #8
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,423

    Re: Highlite active cell

    Pls try this code

    Please Login or Register  to view this content.
    Last edited by wk9128; 03-25-2024 at 07:17 AM.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Highlite active cell

    Please Login or Register  to view this content.
    Code for a sheet
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  10. #10
    Registered User
    Join Date
    12-28-2023
    Location
    Antwerp
    MS-Off Ver
    365
    Posts
    19

    Re: Highlite active cell

    That's one big step forward for sure.

    Although second question connected with it, on my worksheet I have several ranges in differend colors set up and this code will turn the whole sheet in white. Is it possible to set only the cell I'm working with in a coulour without changing the whole sheet?

    I have changed some numbers with in the first line so the sheet goes completely black on nr 1, 2 is grey, 3 is red, 4 is green. But then it will araze the whole sheet.
    Are we still missing something here ?

  11. #11
    Registered User
    Join Date
    12-28-2023
    Location
    Antwerp
    MS-Off Ver
    365
    Posts
    19

    Re: Highlite active cell

    Is this a stand alone code or has it has to go with some others, like color, etc, bacaus on its own it has no effect what so ever.

  12. #12
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Highlite active cell

    Quote Originally Posted by JohnTopley View Post
    Please Login or Register  to view this content.
    This code should use Worksheet_SelectionChange instead of Worksheet_Change

    Please Login or Register  to view this content.
    This code will put the address of the active cell into cell A1 anytime the user changes the selection. To format the active cell, this code must be used together with a conditional formatting rule:

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

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

    (entire sheet)

    This could be done all in VBA without adding a conditional formatting rule, but the code would have to make a record of the original formatting of the cell first so it can be restored when the selection changes. Or the code would have to continually create and destroy conditional formatting rules on the fly. These options are more complicated than just adding a conditional formatting rule.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  13. #13
    Registered User
    Join Date
    12-28-2023
    Location
    Antwerp
    MS-Off Ver
    365
    Posts
    19

    Re: Highlite active cell

    This is great, it's working lik a charm now.
    Thx for your input and time :-)

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,858

    Re: Highlite active cell

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so. Cross-posts are allowed but you must provide a link to your posts on other sites.

    Please see Forum Rule #7 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important: https://excelguru.ca/a-message-to-forum-cross-posters/

    (Note: this requirement is not optional. I shall do it for you once only: https://www.helpmij.nl/forum/threads...e-cell.971463/)

  15. #15
    Registered User
    Join Date
    12-28-2023
    Location
    Antwerp
    MS-Off Ver
    365
    Posts
    19

    Re: Highlite active cell

    Yes, I posted some thaughts on a Dutch help page, if that might help You, because sometimes there are issues with Dutch and English connotations in programming, it help when programs use both languages. For example, the vba code mostely is English, but conditional formatting is Dutch. Is there a special spot where I can place it or is just telling enough, I didn't know it was that important, there for my excuses.

  16. #16
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Highlite active cell

    When you post the same question to another site, we require that you provide a link here so people can see if it's already been answered someplace else. A link in your post is all that's needed.

    We don't have many rules, and they are all important.

  17. #17
    Registered User
    Join Date
    12-28-2023
    Location
    Antwerp
    MS-Off Ver
    365
    Posts
    19

    Re: Highlite active cell

    Ok thx, will do!

+ 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. [SOLVED] Excel Data Search With Conditional Formatting Highlite Cell
    By tariqjahangir in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-23-2019, 05:47 PM
  2. [SOLVED] Highlite cell if if it's row contains more than 1 column with data in it.
    By csh8428 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2014, 05:30 PM
  3. Replies: 1
    Last Post: 04-11-2013, 01:49 PM
  4. Replies: 2
    Last Post: 12-23-2012, 09:26 AM
  5. Highlite or underline active cell row
    By jcarstens in forum Excel General
    Replies: 2
    Last Post: 05-28-2009, 06:01 PM
  6. Replies: 1
    Last Post: 05-20-2005, 01:07 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