Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Determine which button was selected ??

Hi! Help!! I'm a Tech coordinator at an elementry school. We have a
SmartBoard whiteboard and we want to use it to hold a mock presidential
election. In an Excel 2002 spreadsheet I have the candidates pictures in A1,
A2 and A3. Their names appear in B1, B2 and B3. What I need to set up is to
have a macro (I guess?) that will detect a click (or touch) in either C1, C2
or C3 and record a one (1) in the corresponding D1, D2 or D3 box (which are
all off the screen on the right - out of sight). Then I need a macro or
formula to add each additional vote (or one) for that candidate to the
acculumating total in D1, D2 or D3 (-- or E1, E2 or E3 if necessary).
Basically, I'd like the students to walk up to the SmartBoard and be able
to touch the screen (the same as mouse clicking in a cell) in a box next to
their candidate to vote for him and have that "vote" recorded and totaled in
a cell that is off the screen to the right. Thus each time a student touches
or "clicks" on a selection box, a vote is recorded for that candidate.
I was told by the people at Microsoft that this is possible using a very
simple Visual Basic macro and I went to the following web page, but I could
not make sense of it or make it work:
http://support.microsoft.com/default...b;en-us;143345
The kids and I would really appreciate any help with this that you may
offer. Time is short as we have to hold this mock election on Friday, Oct.
29!! Thank you in advance, Dcarr

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Determine which button was selected ??

I would trap the event click of the sheet in a cell

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Then I would test the target column to see which column was used

then I would use a select statement to see if which person to increase the
date.

If you are not familiar with sheet events you can email me at
where you take out the no spam. Send me the
spreadsheet and I can do if for you in about 5 min. Anything to teach
children to vote works for me!!!

Please put a title of Children Pres Election

Good Luck

Stewart Rogers


"dcarr" wrote:

Hi! Help!! I'm a Tech coordinator at an elementry school. We have a
SmartBoard whiteboard and we want to use it to hold a mock presidential
election. In an Excel 2002 spreadsheet I have the candidates pictures in A1,
A2 and A3. Their names appear in B1, B2 and B3. What I need to set up is to
have a macro (I guess?) that will detect a click (or touch) in either C1, C2
or C3 and record a one (1) in the corresponding D1, D2 or D3 box (which are
all off the screen on the right - out of sight). Then I need a macro or
formula to add each additional vote (or one) for that candidate to the
acculumating total in D1, D2 or D3 (-- or E1, E2 or E3 if necessary).
Basically, I'd like the students to walk up to the SmartBoard and be able
to touch the screen (the same as mouse clicking in a cell) in a box next to
their candidate to vote for him and have that "vote" recorded and totaled in
a cell that is off the screen to the right. Thus each time a student touches
or "clicks" on a selection box, a vote is recorded for that candidate.
I was told by the people at Microsoft that this is possible using a very
simple Visual Basic macro and I went to the following web page, but I could
not make sense of it or make it work:
http://support.microsoft.com/default...b;en-us;143345
The kids and I would really appreciate any help with this that you may
offer. Time is short as we have to hold this mock election on Friday, Oct.
29!! Thank you in advance, Dcarr

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Determine which button was selected ??

One way

You can assign a macro to the picture like this

Sub test()
Range("C1").Value = Range("C1").Value + 1
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"dcarr" wrote in message ...
Hi! Help!! I'm a Tech coordinator at an elementry school. We have a
SmartBoard whiteboard and we want to use it to hold a mock presidential
election. In an Excel 2002 spreadsheet I have the candidates pictures in A1,
A2 and A3. Their names appear in B1, B2 and B3. What I need to set up is to
have a macro (I guess?) that will detect a click (or touch) in either C1, C2
or C3 and record a one (1) in the corresponding D1, D2 or D3 box (which are
all off the screen on the right - out of sight). Then I need a macro or
formula to add each additional vote (or one) for that candidate to the
acculumating total in D1, D2 or D3 (-- or E1, E2 or E3 if necessary).
Basically, I'd like the students to walk up to the SmartBoard and be able
to touch the screen (the same as mouse clicking in a cell) in a box next to
their candidate to vote for him and have that "vote" recorded and totaled in
a cell that is off the screen to the right. Thus each time a student touches
or "clicks" on a selection box, a vote is recorded for that candidate.
I was told by the people at Microsoft that this is possible using a very
simple Visual Basic macro and I went to the following web page, but I could
not make sense of it or make it work:
http://support.microsoft.com/default...b;en-us;143345
The kids and I would really appreciate any help with this that you may
offer. Time is short as we have to hold this mock election on Friday, Oct.
29!! Thank you in advance, Dcarr



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Determine which button was selected ??

There is a problem inherent to clicking in cells to count votes... if you
scroll from left to right, you just cast three votes. I suggest adding
buttons that the kids can click on. If you would like more help, I can
tomorrow AM (Thursday, 10/28)

Dale Preuss




"dcarr" wrote:

Hi! Help!! I'm a Tech coordinator at an elementry school. We have a
SmartBoard whiteboard and we want to use it to hold a mock presidential
election. In an Excel 2002 spreadsheet I have the candidates pictures in A1,
A2 and A3. Their names appear in B1, B2 and B3. What I need to set up is to
have a macro (I guess?) that will detect a click (or touch) in either C1, C2
or C3 and record a one (1) in the corresponding D1, D2 or D3 box (which are
all off the screen on the right - out of sight). Then I need a macro or
formula to add each additional vote (or one) for that candidate to the
acculumating total in D1, D2 or D3 (-- or E1, E2 or E3 if necessary).
Basically, I'd like the students to walk up to the SmartBoard and be able
to touch the screen (the same as mouse clicking in a cell) in a box next to
their candidate to vote for him and have that "vote" recorded and totaled in
a cell that is off the screen to the right. Thus each time a student touches
or "clicks" on a selection box, a vote is recorded for that candidate.
I was told by the people at Microsoft that this is possible using a very
simple Visual Basic macro and I went to the following web page, but I could
not make sense of it or make it work:
http://support.microsoft.com/default...b;en-us;143345
The kids and I would really appreciate any help with this that you may
offer. Time is short as we have to hold this mock election on Friday, Oct.
29!! Thank you in advance, Dcarr

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Determine which button was selected ??

Hi dcarr,
Copy the following code into the sheet code Project Editor. (Right click the
sheet tab and click on View Code, use ALT + TAB to get back the sheet.)
Make three buttons from the Forms tool bar and Format the text to each
candidates name.
Right click the buttons and click on Assign Macro and assign the code to the
proper button.
Bush votes are totaled in cell I2, Kerry in I3 and Nader in I4.

HTH
Regards,
Howard

Sub BUSH()
If MsgBox _
("You voted for BUSH, is that a correct choice?", _
vbYesNo, "BUSH VOTE") = vbNo Then
Exit Sub
End If
Range("I2").Value = Range("I2").Value + 1
End Sub

Sub KERRY()
If MsgBox _
("You voted for KERRY, is that a correct choice?", _
vbYesNo, "KERRY VOTE") = vbNo Then
Exit Sub
End If
Range("I3").Value = Range("I3").Value + 1
End Sub

Sub NADER()
If MsgBox _
("You voted for NADER, is that a correct choice?", _
vbYesNo, "NADER VOTE") = vbNo Then
Exit Sub
End If
Range("I4").Value = Range("I4").Value + 1
End Sub


"dcarr" wrote in message
...
Hi! Help!! I'm a Tech coordinator at an elementry school. We have a
SmartBoard whiteboard and we want to use it to hold a mock presidential
election. In an Excel 2002 spreadsheet I have the candidates pictures in
A1,
A2 and A3. Their names appear in B1, B2 and B3. What I need to set up is
to
have a macro (I guess?) that will detect a click (or touch) in either C1,
C2
or C3 and record a one (1) in the corresponding D1, D2 or D3 box (which
are
all off the screen on the right - out of sight). Then I need a macro or
formula to add each additional vote (or one) for that candidate to the
acculumating total in D1, D2 or D3 (-- or E1, E2 or E3 if necessary).
Basically, I'd like the students to walk up to the SmartBoard and be able
to touch the screen (the same as mouse clicking in a cell) in a box next
to
their candidate to vote for him and have that "vote" recorded and totaled
in
a cell that is off the screen to the right. Thus each time a student
touches
or "clicks" on a selection box, a vote is recorded for that candidate.
I was told by the people at Microsoft that this is possible using a very
simple Visual Basic macro and I went to the following web page, but I
could
not make sense of it or make it work:
http://support.microsoft.com/default...b;en-us;143345
The kids and I would really appreciate any help with this that you may
offer. Time is short as we have to hold this mock election on Friday, Oct.
29!! Thank you in advance, Dcarr



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
determine the name of the selected pivot table Tim879 Excel Discussion (Misc queries) 1 September 23rd 07 05:02 PM
How do I lock a radio button group if a N/A button is selected worry a lot Excel Discussion (Misc queries) 2 May 21st 05 08:33 PM
Determine exctent of selected range Michael Allen[_2_] Excel Programming 2 July 5th 04 05:01 PM
Determine which button Senile Excel Programming 2 November 20th 03 11:21 PM
Determine Selected Cells John Tripp[_2_] Excel Programming 2 July 31st 03 02:48 PM


All times are GMT +1. The time now is 05:25 PM.

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"