
10-16-2009, 10:30 AM
|
|
Freshman
|
|
Join Date: Jul 2009
Posts: 40
|
|
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
|