I have a simple grocery list that I would like to be able to click on a cell and have it go to a filled radio circle from an empty radio circle and back if I make a mistake so I can quickly check off items I need on a grocery list. It can also go from a square to a square with a check mark.
Can’t seem to be able to do this without cutting and pasting all the time.
I like to keep multiple columns to see what I have actually bought in the rece
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Check box or radio circle on and off in a cell by clicking
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Check box or radio circle on and off in a cell by clicking
- This topic has 16 replies, 4 voices, and was last updated 12 years, 2 months ago.
AuthorTopicWSjrklein
AskWoody LoungerApril 5, 2013 at 1:33 pm #488651Viewing 10 reply threadsAuthorReplies-
Maudibe
AskWoody_MVPApril 5, 2013 at 4:52 pm #1385518Jr,
Here is some code that will allow you to place a check in a cell by clicking on it then remove it by clicking on the cell again. Place the following code in the sheet module for the sheet you are using. Change the range in the code (“C3:E7”) to the range of cells you need.
HTH,
MaudCode:Private Sub Worksheet_SelectionChange(ByVal Target As Range) On Error Resume Next If Target.Cells.Count > 1 Then Exit Sub ‘IF SELECT MORE THAN ONE CELLTHAN EXIT THE ROUTINE If Not Intersect(Target, Range(“C3:E7”)) Is Nothing Then ‘IF THE SELECTED CELL AND RANGE OVERLAP THEN…. Target.Font.Name = “Marlett” ‘CHANGE THE FONT OF THE SELECTED CELL TO MARLETT If Target = vbNullString Then ‘IF THE SELECTED CELL IS EMPTY THEN… Target = “a” ‘PLACE A CHECKMARK Range(“A1”).Select ‘CHANGE TO ANOTHER CELL IF A1 IS PART OF THE RANGE Else ‘IF IT IS NOT EMPTY THEN…. Target = vbNullString ‘MAKE IT EMPTY Range(“A1”).Select ‘CHANGE TO ANOTHER CELL IF A1 IS PART OF THE RANGE End If End If End Sub
-
WSjrklein
AskWoody LoungerApril 7, 2013 at 12:48 am #1385811Maud, many many thanks, just wonderful.
1. Any way I can add formatting to increase the font size or change its color to say red bold and slightly larger check mark.
2. Also can the pointer not revert to a1 but to the next cell below as if you had just hit the enter key or something similar.
Right now it moves the whole workbook up and forces you to scroll down for a long list to get back to the area of the workbook you were last in??
Again my thanks
JR -
Maudibe
AskWoody_MVPApril 7, 2013 at 1:22 am #1385813jr,
Easily done: Highlight now only the range with the checkboxes then click bold, red font, 18 font size. See pic below. Adjust the settings to anything you like.
As for the cell that is selected after the check is placed, it can not jumpt to a cell in the range or the code is fired again. For example, if the code is set to select the cell one down, let’s see what happens: You select D3 and place a check then the code selects D4 but the code is fired again. It places a check in D4 then selects D5. The code is run again until i moves below outside of the range.
The best I can do here is select the same row but in column 1.
Code:Private Sub Worksheet_SelectionChange(ByVal Target As Range) On Error Resume Next If Target.Cells.Count > 1 Then Exit Sub ‘IF SELECT MORE THAN ONE CELLTHAN EXIT THE ROUTINE If Not Intersect(Target, Range(“C3:E7”)) Is Nothing Then ‘IF THE SELECTED CELL AND RANGE OVERLAP THEN…. Target.Font.Name = “Marlett” ‘CHANGE THE FONT OF THE SELECTED CELL TO MARLETT If Target = vbNullString Then ‘IF THE SELECTED CELL IS EMPTY THEN… Target = “a” ‘PLACE A CHECKMARK Cells(Target.Row, 1).Select Else ‘IF IT IS NOT EMPTY THEN…. Target = vbNullString ‘MAKE IT EMPTY Cells(Target.Row, 1).Select End If End If End Sub
-
RetiredGeek
AskWoody_MVPApril 7, 2013 at 6:50 am #1385878JR,
This modification will make the code work like pressing the Enter key, e.g. move to the next row in same column.
Code:Private Sub Worksheet_SelectionChange(ByVal Target As Range) On Error Resume Next If Target.Cells.Count > 1 Then Exit Sub 'IF SELECT MORE THAN ONE CELLTHAN EXIT THE ROUTINE If Not Intersect(Target, Range("C3:E7")) Is Nothing Then 'IF THE SELECTED CELL AND RANGE OVERLAP THEN.... Target.Font.Name = "Marlett" 'CHANGE THE FONT OF THE SELECTED CELL TO MARLETT If Target = vbNullString Then 'IF THE SELECTED CELL IS EMPTY THEN... Target = "a" 'PLACE A CHECKMARK Else 'IF IT IS NOT EMPTY THEN.... Target = vbNullString 'MAKE IT EMPTY End If Application.EnableEvents = False Target.Offset(1, 0).Select Application.EnableEvents = True End If End Sub
However, please note that it does strange things if you use the keyboard inside the trapped range. Try the arrow keys, Enter key, and really weird the Space bar. You would have to go into keyboard capturing to resolve these behaviors. But the code works just fine if you use the mouse. Maud’s code does not display all of these behaviors because of the location of the cursor out of the trapped range. But try placing the cursor just outside the trapped range and then press the arrow key that will move the cursor into the trapped range. The point is to make this code fool proof will be a lot of work. If it is just for you no problem as you know it’s limitations but if you are distributing the code there is a lot of work to do. HTH :cheers:
-
WSjrklein
AskWoody Lounger
-
WSjrklein
AskWoody LoungerApril 7, 2013 at 8:15 am #1385906So the “empty” cells of the spreadsheet do not show so “empty”
can the empty cells default from blank to an empty “circle” radio button may be easier to read a long grocery list Please see my original a.xls for the empty circles/radio buttons.
Another words, can the on off formatting of the cell show a different empty kind of symbol versus just being empty
THanksRetiredGeek
AskWoody_MVPApril 7, 2013 at 10:01 am #1385914JR,
This will do the empty box / checked box version:
Code:Private Sub Worksheet_SelectionChange(ByVal Target As Range) On Error Resume Next If Target.Cells.Count > 1 Then Exit Sub 'IF SELECT MORE THAN ONE CELLTHAN EXIT THE ROUTINE If Not Intersect(Target, Range("C3:E7")) Is Nothing Then 'IF THE SELECTED CELL AND RANGE OVERLAP THEN.... Target.Font.Name = "WingDings" 'CHANGE THE FONT OF THE SELECTED CELL TO MARLETT If Target = vbNullString Or Target = Chr(168) Then 'IF THE SELECTED CELL IS EMPTY THEN... Target = Chr(254) 'PLACE A CHECKMARK Else 'IF IT IS NOT EMPTY THEN.... Target = Chr(168) 'MAKE IT EMPTY End If Application.EnableEvents = False Target.Offset(1, 0).Select Application.EnableEvents = True End If End Sub
33615-CheckBoxes
Note: The code will change either a blank cell or one with an unchecked box into a checked box.If you want to start with all unchecked boxes place this code in a standard module
Code:Option Explicit Sub BlankBoxes() Dim rngCell As Range Application.EnableEvents = False For Each rngCell In Selection rngCell = Chr(168) Next rngCell Application.EnableEvents = True End Sub
Then just select the range by dragging press Alt+F8 and double-click BlankBoxes. :cheers:
Maudibe
AskWoody_MVPApril 7, 2013 at 10:12 am #1385916RG,
Thanks for the modification but that is why I wrote: Cells(Target.Row, 1).Select so that it would not be possible to display the behaviors you describe short of giong into design mode, clicking the in the range, then unclicking design mode.Jr,
The limitation is the characters contained in the font. Your request can be done by changing the font to Wingdings and using different characters (done by altering code). See Wingdings.xls. If you do not have Windings installed use Marlett.xlsWingdings
33617-Check3Marlett
33618-Check4Code:Private Sub Worksheet_SelectionChange(ByVal Target As Range) On Error Resume Next If Target.Cells.Count > 1 Then Exit Sub ‘IF SELECT MORE THAN ONE CELLTHAN EXIT THE ROUTINE If Not Intersect(Target, Range(“C3:E7”)) Is Nothing Then ‘IF THE SELECTED CELL AND RANGE OVERLAP THEN…. Target.Font.Name = “Wingdings” ‘CHANGE THE FONT OF THE SELECTED CELL TO MARLETT If Target = “¡” Then ‘IF THE SELECTED CELL IS EMPTY THEN… Target = “ü” ‘PLACE A CHECKMARK Cells(Target.Row, 1).Select Else ‘IF IT IS NOT EMPTY THEN…. Target = “¡” ‘MAKE IT EMPTY Cells(Target.Row, 1).Select End If End If End Sub
-
RetiredGeek
AskWoody_MVPApril 7, 2013 at 10:19 am #1385920RG,
Thanks for the modification but that is why I wrote: Cells(Target.Row, 1).Select so that it would not be possible to display the behaviors you describe short of giong into design mode, clicking the in the range, then unclicking design mode.Maud,
I know that’s what I said:
Maud’s code does not display all of these behaviors because of the location of the cursor out of the trapped range.
:cheers:
Maudibe
AskWoody_MVPMaudibe
AskWoody_MVPApril 7, 2013 at 9:22 pm #1385979Jr,
Here is a revised version to allow you to automatically add preformatted rows and columns. The trigger range will grow as you add. The row becomes activated when you add the item name in the first cell of that row. If you want to add a category (ex Vegetables) place an asterisk in front of it and it will be ignored from the range.
-
WSjrklein
AskWoody LoungerApril 8, 2013 at 3:23 pm #1386087Dear Maudibe
Many many thanks, Tried everything really great, Columns add works great
[Rows add fine but have to make certain there is an item in the a column for the new row or won’t work right
which is just fine
(sorry for the late response I was away and only had my Iphone and surprisingly could not view xls files on it)
Again my thanks
JR
Maudibe
AskWoody_MVP-
zeddy
AskWoody_MVPApril 9, 2013 at 3:25 pm #1386283Hi Maudibe
If someone posts a sample file of type .xls I always assume that they want a solution that works in Excel2003.
(Otherwise they would post a file of type .xlsx???)Your file is incompatible with Excel2003, because it uses vba functions like
.ThemeColor
.TintAndShade
..so it will give a debug error you try to add rows or columns using your ActiveX control buttons.Where possible I prefer to use ‘Form buttons’on a worksheet rather than ActiveX ‘Control buttons’.
Using the Selection change event can be problematic for the intended purpose requested.
For example, in your file, if you put the cellpointer in cell [K4] and then use the [Left Arrow] key,
the entry in cell [J4] changes as the cellpointer jumps to column [A].
This could easily go unnoticed (especially if there were lots more columns).I changed the method to use the mouse right-click event instead.
This leaves the cellpointer on the selected cell and just toggles the value from tick to circle etc. each time you right-click the mouse.
(You could also use the double-click event instead)So I have adapted your file to my attached version.
Rows can be added by clicking the [Add Row] button, and this does not require pre-existing entries in [A]Check out my vba code to see different way of doing things.
zeddy
RetiredGeek
AskWoody_MVPApril 9, 2013 at 3:39 pm #1386286Zeddy,
Very Nice! :thewave:
-
zeddy
AskWoody_MVP
Viewing 10 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Acronis : Tracking Chaos RAT’s evolution (Windows, Linux)
by
Alex5723
6 hours, 29 minutes ago -
Turning off OneDrive
by
CWBillow
10 hours, 59 minutes ago -
June 2025 updates are out
by
Susan Bradley
2 hours, 6 minutes ago -
Mozilla shutting Deep Fake Detector
by
Alex5723
21 hours, 16 minutes ago -
Windows-Maintenance-Tool (.bat)
by
Alex5723
6 hours, 38 minutes ago -
Windows 11 Insider Preview build 26200.5641 released to DEV
by
joep517
23 hours, 48 minutes ago -
Windows 11 Insider Preview build 26120.4250 (24H2) released to BETA
by
joep517
23 hours, 50 minutes ago -
Install Office 365 Outlook classic on new Win11 machine
by
WSrcull999
23 hours, 47 minutes ago -
win 10 to win 11 with cpu/mb replacement
by
aquatarkus
15 hours, 40 minutes ago -
re-install Windows Security
by
CWBillow
1 day, 3 hours ago -
WWDC 2025 Recap: All of Apple’s NEW Features in 10 Minutes!
by
Alex5723
1 day, 6 hours ago -
macOS Tahoe 26
by
Alex5723
1 day ago -
Migrating from win10 to win11, instructions coming?
by
astro46
13 hours, 3 minutes ago -
Device Eligibility for Apple 2026 Operating Systems due this Fall
by
PKCano
15 hours, 31 minutes ago -
Recommended watching : Mountainhead movie
by
Alex5723
16 hours, 15 minutes ago -
End of support for Windows 10
by
Old enough to know better
16 hours, 11 minutes ago -
What goes on inside an LLM
by
Michael Covington
10 hours, 25 minutes ago -
The risk of remote access
by
Susan Bradley
50 minutes ago -
The cruelest month for many Office users
by
Peter Deegan
22 hours, 28 minutes ago -
Tracking protection and trade-offs in Edge
by
Mary Branscombe
20 hours, 30 minutes ago -
Supreme Court grants DOGE access to confidential Social Security records
by
Alex5723
2 days, 5 hours ago -
EaseUS Partition Master free 19.6
by
Alex5723
1 day, 5 hours ago -
Microsoft : Edge is better than Chrome
by
Alex5723
2 days, 18 hours ago -
The EU launched DNS4EU
by
Alex5723
3 days, 7 hours ago -
Cell Phone vs. Traditional Touchtone Phone over POTS
by
280park
2 days, 21 hours ago -
Lost access to all my networked drives (shares) listed in My Computer
by
lwerman
3 days, 12 hours ago -
Set default size for pasted photo to word
by
Cyn
3 days, 18 hours ago -
Dedoimedo tries 24H2…
by
Cybertooth
3 days, 6 hours ago -
Windows 11 Insider Preview build 27871 released to Canary
by
joep517
4 days, 17 hours ago -
Windows 11 ad from Campaign Manager in Windows 10
by
Jim McKenna
2 days, 10 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.