Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cell macro to update checkbox based on cell value

Status
Not open for further replies.

jerryk

Programmer
Jun 13, 2001
82
US
I have a spreadsheet with several checkboxes and 1 hidden cell. When the cell gets a number keyed in, I need a macro to turn on one of the checkboxes, based on the number.

I assume this is simple, but I'm not a VB/VBA guy. Many thanks for any who can help!

macro Pseudocode:

Sub cellr3c21_Change()
if mycellvalue == 1 then checkbox1.clicked = yes.
if mycellvalue == 2 then checkbox2.clicked = yes.
if mycellvalue == 3 then checkbox3.clicked = yes.
etc......
End Sub
 
Addendum, looking at it differently, can each checkbox have a property that constantly reads a particular cell, say, r4c10?

then the checkbox could instantly set itself to "on" if r4c10 = a particular number?

 
Fixed it myself.

I linked each checkbox to a True/false cell. (they'll be hidden)

Then, I put my "test value" in another cell. (again hidden).

The True/False cells all toggle themselves based on the "test value" cell's data, and the checkboxes update accordingly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top