circaa
06-01-2006, 01:01 PM
Hi guys
I wanna loop through all my optionbuttons to find which one is set to true and then write it's Caption in a cell. The line " ActiveCell.text = optbut.Caption" is wrong but i don't know why. Any ideas ?
Dim optbut As Object
For Each optbut In Me.Controls
If TypeName(optbut) = "OptionButton" Then
If optbut.Object.GroupName = "centre" Then
If optbut.Value = True Then
ActiveCell.text = optbut.Caption
End If
End If
End If
Next optbut
I wanna loop through all my optionbuttons to find which one is set to true and then write it's Caption in a cell. The line " ActiveCell.text = optbut.Caption" is wrong but i don't know why. Any ideas ?
Dim optbut As Object
For Each optbut In Me.Controls
If TypeName(optbut) = "OptionButton" Then
If optbut.Object.GroupName = "centre" Then
If optbut.Value = True Then
ActiveCell.text = optbut.Caption
End If
End If
End If
Next optbut