Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
I have the following procedure for a checkbox. The trouble is it feels very
cumbersome and long and I have to do it for each box; is there a shorter more efficient way to do the same? Private Sub CheckBox87_Click() cellno = "f34" If CheckBox87.Value = True Then Me.Cells.Range(cellno).Font.Color = RGB(0, 255, 0) Me.Cells.Range(cellno).Font.Bold = True CheckBox88.Visible = False Else: Me.Cells.Range(cellno).Font.Color = RGB(0, 0, 255) Me.Cells.Range(cellno).Font.Bold = False CheckBox88.Visible = True End If Because I need a large number of these boxes, I was thinking of a routine such as; For i = 1 to 200 If CheckBox(i).Value = True Then Me.Cells.Range(cellno).Font.Color = RGB(0, 255, 0) Me.Cells.Range(cellno).Font.Bold = True CheckBox(i+1).Visible = False Else: Me.Cells.Range(cellno).Font.Color = RGB(0, 0, 255) Me.Cells.Range(cellno).Font.Bold = False CheckBox(i+1).Visible = True End If next i which would be a load easier than having to copy this the required number of times for each checkbox. Can anybody guide me in the right direction please? Many thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Ideas for simplifying cell formulas | Excel Discussion (Misc queries) | |||
Fast Fourier Transform routine in Tools add-in menu | Excel Worksheet Functions | |||
Suppressing startup routine | Excel Discussion (Misc queries) | |||
How to create a routine | Excel Discussion (Misc queries) | |||
Convert Sub routine to Function | Excel Worksheet Functions |