PDA

View Full Version : Solved: writing option button caption in a cell



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

mdmackillop
06-01-2006, 01:23 PM
Try

ActiveCell = optbut.Caption

Regards
MD

circaa
06-02-2006, 05:18 AM
Still won't work

circaa
06-02-2006, 05:35 AM
Ok it works fine

thanks MD