Applying my macro to a range of cells...

Solved/Closed
lorihohen Posts 3 Registration date Tuesday December 31, 2013 Status Member Last seen January 2, 2014 - Dec 31, 2013 at 06:17 PM
 Blocked Profile - Jan 3, 2014 at 08:56 AM
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
Related:

3 replies

Blocked Profile
Dec 31, 2013 at 06:32 PM
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"?

0
lorihohen Posts 3 Registration date Tuesday December 31, 2013 Status Member Last seen January 2, 2014
Jan 1, 2014 at 10:37 PM
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"?
0
Blocked Profile
Jan 2, 2014 at 10:20 AM
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.
0
lorihohen Posts 3 Registration date Tuesday December 31, 2013 Status Member Last seen January 2, 2014
Jan 2, 2014 at 08:48 PM
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.
0
Blocked Profile
Jan 3, 2014 at 08:56 AM
I am glad that this worked for you. Will you be so kind to mark it as solved?
0