+ Reply to Thread
Results 1 to 6 of 6

How to catch when the user clicks a cell?

  1. #1
    Registered User
    Join Date
    10-26-2007
    Location
    UK
    Posts
    4

    How to catch when the user clicks a cell?

    Hello,

    I have a simple yet tricky task I cannot really solve. I want to write a macro that makes green the background of that cell, which the user clicks. But I can't find any "click" event for a cell. Can this thing still be achieved somehow? It would be urgent, I need to finish this today or Monday at the latest.

    Thank you a lot in advance.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493
    Here's one way that should work

    place this in worksheet module
    Right click on the sheet tab and select view codes
    paste this code there

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-26-2007
    Location
    UK
    Posts
    4
    Thank you a lot, you are great, it works for E1! Now just two short questions:

    - How to modify the "If Target.Address = "$E$1" Then" line if I want this code to work for a range (let's say C12:S51)?

    - Where do you know "Worksheet_SelectionChange" from? I couldn't find it in VBA's help.

    Thank you.

  4. #4
    Registered User
    Join Date
    10-26-2007
    Location
    UK
    Posts
    4
    I found the answer for my first question :-)

    Please Login or Register  to view this content.
    Last edited by VBA Noob; 10-26-2007 at 08:45 AM.

  5. #5
    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
    _________________________________________


    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 !!!

  6. #6
    Registered User
    Join Date
    10-26-2007
    Location
    UK
    Posts
    4
    Thank you!

+ 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