Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]() Code: -------------------- Private Sub CheckBox(*VARIABLE*)_Click() i = (*VARIABLE*) Range("E" & i + 13).Select ActiveCell.FormulaR1C1 = _ "=IF(RC[-1]=""x"", IF(RC[-4]="""", ""<ERROR"", IF(RC[-3]="""", ""<ERROR"", IF(RC[-2]="""", ""<ERROR"", """"))),"""")" Worksheets("User Editable Sheet 1").Range("d" & i + 13) = "x" If Worksheets("User Editable Sheet 1").Range("E" & i + 13) = "<ERROR" Then If Worksheets("User Editable Sheet 1").Range("A" & i + 13) = "" Then Worksheets("User Editable Sheet 1").Range("A" & i + 13).Interior.ColorIndex = 3 Else Worksheets("User Editable Sheet 1").Range("A" & i + 13).Interior.ColorIndex = 36 End If If Worksheets("User Editable Sheet 1").Range("B" & i + 13) = "" Then Worksheets("User Editable Sheet 1").Range("B" & i + 13).Interior.ColorIndex = 3 Else Worksheets("User Editable Sheet 1").Range("B" & i + 13).Interior.ColorIndex = 36 End If If Worksheets("User Editable Sheet 1").Range("C" & i + 13) = "" Then Worksheets("User Editable Sheet 1").Range("C" & i + 13).Interior.ColorIndex = 3 Else Worksheets("User Editable Sheet 1").Range("C" & i + 13).Interior.ColorIndex = 36 End If CheckBox(*VARIABLE*).Value = False Range("e" & i + 13) = "<ERROR" Else Worksheets("User Editable Sheet 1").Range("A" & i + 13).Interior.ColorIndex = 36 Worksheets("User Editable Sheet 1").Range("B" & i + 13).Interior.ColorIndex = 36 Worksheets("User Editable Sheet 1").Range("C" & i + 13).Interior.ColorIndex = 36 End If End Sub -------------------- NOTE: THAT SOME LINES MAY HAVE CHANGED UPON ME COPYING THIS INTO THE FORUMS. I have 143 checkboxes, I understand its not advisable to name objects by their default names, but as there are so many it would take far too long to change each one. I would like the above statement to be the same for all 143 checkboxes. Is there a simple way of doing this? Parts marked (VARIABLE) is a number from 1 all the way through to 143. Thank you very much in advance. -- aking1987 ------------------------------------------------------------------------ aking1987's Profile: http://www.excelforum.com/member.php...o&userid=15393 View this thread: http://www.excelforum.com/showthread...hreadid=273563 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
entering numbers to display a time format | Excel Discussion (Misc queries) | |||
Help - Information with time and date | Excel Discussion (Misc queries) | |||
Combined date time cell to separate date & time components | Excel Discussion (Misc queries) | |||
Combined date time cell to separate date & time components | Excel Discussion (Misc queries) | |||
Combined date time cell to separate date & time components | Excel Discussion (Misc queries) |