View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Francis Hookham Francis Hookham is offline
external usenet poster
 
Posts: 125
Default Clearing radio buttons

Thank you Gary

"Gary Keramidas" wrote in message
...
set it to false

userform1.optionbutton1=false

--

Gary
Excel 2003


"Francis Hookham" wrote in message
...
The clicked radio button in a UserForm does not clear so clicking the
same button again does not work, whereas clicking another radio button
next does work.



Is there an instruction I should incorporate to clear the previous
clicking of the button? If so what and where should it go?



Francis Hookham



--------------------------------------------------------------



Private Sub OptionButton6_Click()

'colour frame(s) orange

Userform1.Hide

ColourOrange

End Sub



Sub ColourOrange()

FindFrameRow

'set colour

ActiveWorkbook.Colors(21) = RGB(255, 245, 225)

FillColour = 21

OneShotColour

End Sub



Sub FindFrameRow()

If ActiveCell.Row = 1 Or ActiveCell.Row = 2 Then

RowNo = 3

Else

RowNo = ActiveCell.Row

While Cells(RowNo, 1) = ""

RowNo = RowNo - 1

Wend

End If

Cells(RowNo, 1).Select

End Sub



Sub OneShotColour()

'given 'RowNo', this performs the colour change of one shot

Range(Cells(RowNo, 2), Cells(RowNo + 15, 10)). _

Interior.ColorIndex = FillColour

Cells(RowNo, 7).Interior.ColorIndex = xlNone

Cells(RowNo, 9).Interior.ColorIndex = xlNone

End Sub