Applying my macro to a range of cells... [Solved/Closed]

Report
Posts
3
Registration date
Tuesday December 31, 2013
Status
Member
Last seen
January 2, 2014
-
ac3mark
Posts
13031
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
-
I found this macro and it works perfectly....inserts an "x" on a single mouse click into cells, but I only want it active on a certain range of cells. How do I change the macro to make it functionally only on c4 thru s20?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If UCase(Target.Value) = "X" Then
Target.Value = ""
Else
Target.Value = "X"
End If
End Sub
Posts
13031
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1573
Wow, what a scope!

*Define on what conditions the count will increment.
Do you wish to have another X added to an already building column of "x's"?

lorihohen
Posts
3
Registration date
Tuesday December 31, 2013
Status
Member
Last seen
January 2, 2014

No. This worksheet was designed for a simple purpose. I work with adults with disabilities and created a work/chore chart that will be available to them on an interactive whiteboard (just want them to tap the board and have an "x" appear in the spreadsheet to indicate their job choice for the day). As you can see by my profession, I'm not computer genius, but I found this cool macro that works great for my purposes. The only problem is, if they "click" by accident on the wrong cell, an x will appear where I don't want an x. How can amend the macro to make it only work of the cells that are "touchable"?
Posts
13031
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1573
Lorihohen,

You can lock down the whole sheet, by selecting all cells, then right click, and select FORMAT CELL. Go to the protection tab, and LOCK all of the cells.

Now go to the column that you wish to have them "click" on, and unlock those cells. Now go to the Main tab, and protect the sheet with a password. Now, it will only heck an x on unlocked cells. I am not certain how we can prevent "Mary" from checking on "Bob's" list, though.
Posts
3
Registration date
Tuesday December 31, 2013
Status
Member
Last seen
January 2, 2014

Worked beautifully! Thanks. If they check a box on the wrong list, that's easily correctable. What wasn't easily correctable was if they clicked on a heading or the some other text box, and this solved that problem.
ac3mark
Posts
13031
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1573
I am glad that this worked for you. Will you be so kind to mark it as solved?