+ Reply to Thread
Results 1 to 4 of 4

Action when cell is clicked

  1. #1
    Registered User
    Join Date
    01-08-2010
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003
    Posts
    29

    Action when cell is clicked

    Hi,

    I have a locked worksheet where there is data in the range B6:FT43, however only some of the cells contain data (which cells contain the data and the number of cells containing data depends on what is entered on the form). The cells can be selected but cannot be changed as they are locked.

    What I would like to do is, if there is data in a cell and it is clicked on, I would like a form to show asking if they would like to delete the entry. If no is clicked then nothing happens, but if yes is clicked then the data within the cell is removed (cell to remain). If there is no data in the cell when it is clicked, nothing should happen.

    I was wondering if something like this can be done, and if so, how?

    Hope it makes sense?

    Thanks,
    LSM1604

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Action when cell is clicked

    Please Login or Register  to view this content.
    This is worksheet event code, which means that it needs to be
    placed in the appropriate worksheet code module, not a standard
    code module. To do this, right-click on the sheet tab, select
    the View Code option from the menu, and paste the code in.

  3. #3
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Action when cell is clicked

    Try this:

    Please Login or Register  to view this content.

    Right click on the sheet tab, select view code and paste the above onto the code sheet that appears.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  4. #4
    Registered User
    Join Date
    01-08-2010
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Action when cell is clicked

    Thank you very much for your help. I used this section of code:

    Please Login or Register  to view this content.
    Thanks

    LSM1604

+ 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