Check box query

A

Anthony Slater

I have two check boxes on a work sheet.

I have to questions: -

1.I would like that if one is checked then the other is un-
checked

2. When checking a box, a value appears in a particular
cell. The values are in another sheet

I'm thinking along the lines of 'if check box = true then
lookup value in sheet 2 and place it in sheet 1, cell x'

Any help would be appreciated
 
G

Guest

hi,
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
CheckBox2 = False
End If
Cells(1, 1).Select

End Sub

Private Sub CheckBox2_Click()
If CheckBox2 = True Then
CheckBox1 = False
End If
Cells(2, 2).Select
End Sub
you point 2 was too vague. sorry
enjoy
:)
 
G

Guest

hi,
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
CheckBox2 = False
End If
Cells(1, 1).Select

End Sub

Private Sub CheckBox2_Click()
If CheckBox2 = True Then
CheckBox1 = False
End If
Cells(2, 2).Select
End Sub
you point 2 was too vague. sorry
enjoy
:)
 
A

anthony slater

Sorryabout point 2.

What I mean is: -

In sheet 1, I have two checkboxes and Cell c1 is waiting
for a value.

In sheet 2, I have 2 values in cells A1 and A2.

If I tick checkbox 1, then the value from sheet2!A1 is
inserted in sheet1!C1

Therefore, in cell c1, I want a value to appear depending
on what checkbox is ticked.

I hope I explained better this time
 
D

Dick Kusleika

Anthony

For #1, consider using option buttons as described here

http://www.dicks-blog.com/excel/2004/08/grouping_option.html

For #2, link your option buttons to a cell that you aren't using and use a
formula in C1 like

=IF(F1,Sheet2!A1, Sheet2!A1)

where F1 is the cells that's linked to the option buttons. You can make F1
invisible by formatting the font color to be the same as the background
color. What I usually do is link to the cell right behind the control so
the control obscures it.
 
A

Anthony Slater

Dick

Thanks for your input.

The option button worked a treat.

Thanks again and have a good weekend
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top