Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default Radio Button output


Hi All,

I have designed a form in excel with radio buttons 'Yes' And 'No'

How can I fill a cell with Yes if 'Yes' Radio button is selected and No if
'No' Radio button is selected?
Their Inputs of Yes and No are saved on an excel sheet, How can I progam it
such that every record is saved and displayed in Next cell

For eg: If on form I have a Question like:

Are you a Male?
o Yes
o No

The results are exported on excel sheet like:

User Inputs(column header)

Yes
Yes
No
Yes
No
No

Thanks is Advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Radio Button output


For the Yes button:

Private Sub CommandButton1_Click() 'Change button name
If CommandButton1.Value = True Then
ActiveCell = "Yes"
CommandButton1.Value = False
End If
End Sub

Same code for the other button, except ActiveCell = "No".


"sam" wrote in message
...
Hi All,

I have designed a form in excel with radio buttons 'Yes' And 'No'

How can I fill a cell with Yes if 'Yes' Radio button is selected and No if
'No' Radio button is selected?
Their Inputs of Yes and No are saved on an excel sheet, How can I progam
it
such that every record is saved and displayed in Next cell

For eg: If on form I have a Question like:

Are you a Male?
o Yes
o No

The results are exported on excel sheet like:

User Inputs(column header)

Yes
Yes
No
Yes
No
No

Thanks is Advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Radio Button output


P.S.

The code goes in the Form code module.




"sam" wrote in message
...
Hi All,

I have designed a form in excel with radio buttons 'Yes' And 'No'

How can I fill a cell with Yes if 'Yes' Radio button is selected and No if
'No' Radio button is selected?
Their Inputs of Yes and No are saved on an excel sheet, How can I progam
it
such that every record is saved and displayed in Next cell

For eg: If on form I have a Question like:

Are you a Male?
o Yes
o No

The results are exported on excel sheet like:

User Inputs(column header)

Yes
Yes
No
Yes
No
No

Thanks is Advance



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Radio Button output


I am wondering if the first one will really give you everything yow wanted.
If you want a specified range to fill with the answers then maybe this
modified version would work better. Let's say we are using Column D for the
answer range.

Dim x As Long 'Outside the macro

Private Sub CommandButton1_Click() 'Change button name
If CommandButton1.Value = True Then
If x = Nothing Then x = 2
Range("D" & x) = "Yes"
CommandButton1.Value = False
x = x + 1
End If
End Sub

This way, x will update from either macro so that the answers will be in
sync with the questions. Unless, of course, they skip one. This assumes
row 1 will be a header row.

"JLGWhiz" wrote in message
...
For the Yes button:

Private Sub CommandButton1_Click() 'Change button name
If CommandButton1.Value = True Then
ActiveCell = "Yes"
CommandButton1.Value = False
End If
End Sub

Same code for the other button, except ActiveCell = "No".


"sam" wrote in message
...
Hi All,

I have designed a form in excel with radio buttons 'Yes' And 'No'

How can I fill a cell with Yes if 'Yes' Radio button is selected and No
if
'No' Radio button is selected?
Their Inputs of Yes and No are saved on an excel sheet, How can I progam
it
such that every record is saved and displayed in Next cell

For eg: If on form I have a Question like:

Are you a Male?
o Yes
o No

The results are exported on excel sheet like:

User Inputs(column header)

Yes
Yes
No
Yes
No
No

Thanks is Advance





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
radio button help tjb Excel Worksheet Functions 1 September 27th 05 11:51 PM
How change cntrl toolbx radio button from T/F to numeric output? Pat Excel Programming 1 July 27th 05 02:40 PM
"RADIO BUTTON" Ian Shere Excel Discussion (Misc queries) 1 July 4th 05 10:59 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
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True Mcasteel Excel Worksheet Functions 2 October 29th 04 07:06 PM


All times are GMT +1. The time now is 04:32 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"