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

lorihohen 3 Posts Tuesday December 31, 2013Registration date January 2, 2014 Last seen - Dec 31, 2013 at 06:17 PM - Latest reply: ac3mark 9919 Posts Monday June 3, 2013Registration dateModeratorStatus July 16, 2018 Last seen
- 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
See more 

5 replies

ac3mark 9919 Posts Monday June 3, 2013Registration dateModeratorStatus July 16, 2018 Last seen - Dec 31, 2013 at 06:32 PM
0
Thank you
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 3 Posts Tuesday December 31, 2013Registration date January 2, 2014 Last seen - 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"?
ac3mark 9919 Posts Monday June 3, 2013Registration dateModeratorStatus July 16, 2018 Last seen - Jan 2, 2014 at 10:20 AM
0
Thank you
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.
lorihohen 3 Posts Tuesday December 31, 2013Registration date January 2, 2014 Last seen - Jan 2, 2014 at 08:48 PM
0
Thank you
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 9919 Posts Monday June 3, 2013Registration dateModeratorStatus July 16, 2018 Last seen - 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?