USerform/checkboxes/radio button

abea81

New Member
Joined
Mar 16, 2011
Messages
1
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
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,224,541
Messages
6,179,418
Members
452,912
Latest member
alicemil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top