Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
aking1987
 
Posts: n/a
Default Major cost of time.


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
entering numbers to display a time format Ian Williams/Eazygig Excel Discussion (Misc queries) 1 January 10th 05 12:57 PM
Help - Information with time and date PM Excel Discussion (Misc queries) 4 January 6th 05 09:25 AM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 03:48 AM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 01:07 AM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 01:07 AM


All times are GMT +1. The time now is 01:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"