Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > check box true via optionbutton and command button


Reply
 
Thread Tools Display Modes
  #1  
Old 10-16-2009, 10:30 AM
Zanderman Zanderman is offline
Freshman
 
Join Date: Jul 2009
Posts: 40
Default check box true via optionbutton and command button


Hi all I have the following peice off code that im struggling with, I have a form with a option button, a command button and a checkbox, what i would like to do is make the checkbox turn true once the option button has been slected and command button 2 has been clicked, also you will see where i commented out the code to make sheet 2 active, i have a sheet 2 on the speadsheet but this code ends up producing a subscript out of range error can anyone shed some light on these issues please?

Alex

Ps am using VBA 6.5

Private Sub CommandButton2_Click()
Dim NextRow As Long
' Make Sheet2 is active
'Sheets("Sheet2").Activate
' Determine the next empty row
NextRow = Application.WorksheetFunction. _
CountA(Range("d:d")) + 1
'Checks checkbox
If OptionLevel1 Then CheckBox1 = True
End Sub

Last edited by Zanderman; 10-16-2009 at 10:31 AM. Reason: keep forgeting to quote vba 6.5
Reply With Quote
  #2  
Old 10-17-2009, 11:10 AM
Bob Phillips's Avatar
Bob Phillips Bob Phillips is offline
Contributor
 
Join Date: Jul 2009
Posts: 506
Default

You have ONE option button? What is the point, they are meant for choices, you cannot turn one off in the UI.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->