Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Checkbox connection with Macro

Hello,
I have a sheet with about 60 questions. Each question has a 4 checkboxes
that stand for: NA, OK, F, CAT. I need the user to be able to click a
checkbox and another sheet in the workbook to log that answer. The second
sheet, named "Middle Sheet", is set up that Column A has all of the questions
and Column B will have the response from the checkboxes. I only need the
first letter (N, O, F, C) to be placed in column B. If anyone knows how I
could do this that would be great.
Thanks,
Kyle
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Checkbox connection with Macro

Have you tried using the Checkbox_Click() event?

"kyle" wrote:

Hello,
I have a sheet with about 60 questions. Each question has a 4 checkboxes
that stand for: NA, OK, F, CAT. I need the user to be able to click a
checkbox and another sheet in the workbook to log that answer. The second
sheet, named "Middle Sheet", is set up that Column A has all of the questions
and Column B will have the response from the checkboxes. I only need the
first letter (N, O, F, C) to be placed in column B. If anyone knows how I
could do this that would be great.
Thanks,
Kyle

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Checkbox connection with Macro

I have not, how would I use that?
thanks

"crazybass2" wrote:

Have you tried using the Checkbox_Click() event?

"kyle" wrote:

Hello,
I have a sheet with about 60 questions. Each question has a 4 checkboxes
that stand for: NA, OK, F, CAT. I need the user to be able to click a
checkbox and another sheet in the workbook to log that answer. The second
sheet, named "Middle Sheet", is set up that Column A has all of the questions
and Column B will have the response from the checkboxes. I only need the
first letter (N, O, F, C) to be placed in column B. If anyone knows how I
could do this that would be great.
Thanks,
Kyle

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Checkbox connection with Macro

Kyle,

Assuming Checkbox1, Checkbox2, Checkbox3, Checkbox4 are the checkboxes for
the first question (N,O,F,C repectively), then the following code (added to
the module of the sheet the checkboxes are on) will place the answer for the
last checked box (1-4) into cell B1 on the "Middle Sheet" sheet.

Private Sub CheckBox1_Click()
If CheckBox1.Value Then Sheets("Middle Sheet").Range("B1") = "N"
End Sub
Private Sub CheckBox2_Click()
If CheckBox2.Value Then Sheets("Middle Sheet").Range("B1") = "O"
End Sub
Private Sub CheckBox3_Click()
If CheckBox3.Value Then Sheets("Middle Sheet").Range("B1") = "F"
End Sub
Private Sub CheckBox4_Click()
If CheckBox4.Value Then Sheets("Middle Sheet").Range("B1") = "C"
End Sub

The problem with checkboxes is you can make multiple checks (ie. the user
can select all four answers) There are ways around this. The below code
will uncheck the other three checkboxes when Checkbox2 is checked.

Private Sub CheckBox2_Click()
If CheckBox2.Value Then Sheets("Middle Sheet").Range("B1") = "O"
Checkbox1.value = false
Checkbox3.value = false
Checkbox4.value = false
End Sub


However, given that you have 240 checkboxes (60 questions, 4 answers) this
will yield a bunch of code. You may want to use a combobox for your answers
rather than four checkboxes.

Mike

"kyle" wrote:

I have not, how would I use that?
thanks

"crazybass2" wrote:

Have you tried using the Checkbox_Click() event?

"kyle" wrote:

Hello,
I have a sheet with about 60 questions. Each question has a 4 checkboxes
that stand for: NA, OK, F, CAT. I need the user to be able to click a
checkbox and another sheet in the workbook to log that answer. The second
sheet, named "Middle Sheet", is set up that Column A has all of the questions
and Column B will have the response from the checkboxes. I only need the
first letter (N, O, F, C) to be placed in column B. If anyone knows how I
could do this that would be great.
Thanks,
Kyle

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
always recheck data connection library for latest connection strin FurmanGG Excel Discussion (Misc queries) 0 September 14th 07 04:48 PM
Help with connection macro? Kimberly Anne Excel Discussion (Misc queries) 0 May 9th 06 07:04 PM
internet connection via excel macro J_J[_2_] Excel Programming 2 October 18th 05 08:26 PM
using a password to in connection with macro protectio Brian Excel Programming 2 December 16th 04 06:36 AM
sql connection in macro tommy Excel Programming 1 August 31st 04 11:36 PM


All times are GMT +1. The time now is 01:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"