Hey guys,
Above is the code that I am using for a project. The basics of it is I am getting a couple of boxes to become highlighted and the word "Enter" appear when a checkbox is checked. Also, if there is data already in the cell then it is only highlighted in order to keep the data. It works as it is but because there are a lot of checkboxes, it is very tasking on the PC to even open the file. Any suggestions as to reducing the amount of code and making it more efficient is much appreciated.
Thanks,
Kulmjord.
Code:
Private Sub CheckBox13_Click()
Application.ScreenUpdating = False
Dim cell As Range
Dim InputValue As String
On Error Resume Next
Range("I8,I11,I14,I20,I23,I27,I33").Select
If CheckBox13.Value = True Then
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent3
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
For Each cell In Selection
If IsEmpty(cell) Then
cell.Value = "Enter"
End If
Next
End With
Else
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight2
.TintAndShade = 0.799981688894314
.PatternTintAndShade = 0
For Each cell In Selection
If cell.Value = "Enter" Then
cell.Value = ""
End If
Next
End With
If CheckBox14.Value = True Then
Range("I27,I33").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent3
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
For Each cell In Selection
If IsEmpty(cell) Then
cell.Value = "Enter"
End If
Next
End With
End If
End If
Range("I8").Select
End Sub
Above is the code that I am using for a project. The basics of it is I am getting a couple of boxes to become highlighted and the word "Enter" appear when a checkbox is checked. Also, if there is data already in the cell then it is only highlighted in order to keep the data. It works as it is but because there are a lot of checkboxes, it is very tasking on the PC to even open the file. Any suggestions as to reducing the amount of code and making it more efficient is much appreciated.
Thanks,
Kulmjord.