LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default excel vba programme

i have 10 questions. each question has 3 option button
if i select 1 option button for each quesiton it shoud store it in wor
sheet. but it does not. coudl you verify this code.

Private Sub CommandButton1_Click()

Dim LastRow As Object

Set LastRow = Sheet1.Range("a65536").End(xlUp)
If OptionButton1.Value = True Then


LastRow.Offset(1, 1).Value = OptionButton1.Caption
Else
If OptionButton2.Value = True Then
LastRow.Offset(1, 1).Value = OptionButton2.Caption
Else
If OptionButton3.Value = True Then

LastRow.Offset(1, 1).Value = OptionButton3.Caption
End If
End If
End If

LastRow.Offset(1, 0).Value = OptionButton.CaptionTextBox1.Text
LastRow.Offset(1, 1).Value = TextBox2.Text
LastRow.Offset(1, 2).Value = TextBox3.Text


MsgBox "One record written to Sheet1"

response = MsgBox("Do you want to enter another record?", _
vbYesNo)

If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
OptionButton1.Value = False
OptionButton2.Value = False





TextBox1.SetFocus

Else
Unload Me
End If

End Sub


Private Sub CommandButton2_Click()
End

End Sub

Private Sub UserForm_Click()

End Su

--
Message posted from http://www.ExcelForum.com

 
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
How to programme this in excel? Sherees Excel Discussion (Misc queries) 4 December 15th 09 09:22 PM
Why I can copy nothing from excel to word or other programme? Henry Excel Worksheet Functions 0 July 9th 08 10:01 AM
need to find a excel programme for rota's Mike McDonagh Excel Discussion (Misc queries) 1 August 29th 06 03:07 PM
How can I email a sheet, not programme, from excel Brian Cook Excel Discussion (Misc queries) 1 April 30th 06 09:06 PM
Excel Programme Management donnawales Excel Discussion (Misc queries) 1 April 8th 06 03:01 PM


All times are GMT +1. The time now is 07:14 PM.

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

About Us

"It's about Microsoft Excel"