I created a userform where I want to use either a textbox or a radio button once that has been selected I want to create code based on the check box or radio button to create a formula that is used in a loop and is used after I click a button from the userform.....here is my code for a radio button, I prefer to know a more sophisticated code that will work, now I have the code working for the radio button but the value that is spitting out is the same it is not going through the loop....please help
CODE: for radio button
Private Sub OptionButton1_Click()
Dim MAWA_CCF(100000) As Single
Dim CIMIS_Eto(100000) As Single
Dim i As Integer
Dim LA, SLA As Single
Range("M8").Select
LA = ActiveCell.Value
Range("M5").Select
SLA = ActiveCell.Value
Range("G14").Select
For i = 1 To 6
CIMIS_Eto(i) = ActiveCell.Value
ActiveCell.Offset(1, 0).Select
Next i
Range("J14").Select
For i = 1 To 6
If OptionButton1.Value = True Then MAWA_CCF(i) = ((0.7) * (CIMIS_Eto(i)) * (LA) + (0.3) * (SLA)) / 1200
ActiveCell.Value = MAWA_CCF(i)
ActiveCell.Offset(1, 0).Select
Next i
End Sub
CODE: for radio button
Private Sub OptionButton1_Click()
Dim MAWA_CCF(100000) As Single
Dim CIMIS_Eto(100000) As Single
Dim i As Integer
Dim LA, SLA As Single
Range("M8").Select
LA = ActiveCell.Value
Range("M5").Select
SLA = ActiveCell.Value
Range("G14").Select
For i = 1 To 6
CIMIS_Eto(i) = ActiveCell.Value
ActiveCell.Offset(1, 0).Select
Next i
Range("J14").Select
For i = 1 To 6
If OptionButton1.Value = True Then MAWA_CCF(i) = ((0.7) * (CIMIS_Eto(i)) * (LA) + (0.3) * (SLA)) / 1200
ActiveCell.Value = MAWA_CCF(i)
ActiveCell.Offset(1, 0).Select
Next i
End Sub