I have a userform with checkboxes that push a yes or no into another sheet that drives the model. The problem is the code is bogging down and taking too long to refresh. Does anyone have an easier way to loop through all the checkboxes on the userform and push the yes / no into the cells? Below is an example of what I'm doing:
Private Sub UpdateTable()
Dim DBoard As Worksheet
Dim CBoxRow As Long
Dim TrackerOff As String
Set DBoard = ThisWorkbook.Sheets("Woodside Dashboard")
Application.ScreenUpdating = False
Application.Calculation = xlManual
Application.EnableEvents = False
If CboxRow4.Value = True Then DBoard.Cells(4, 4) = "Yes" Else DBoard.Cells(4, 4) = "No"
If CboxRow5.Value = True Then DBoard.Cells(5, 4) = "Yes" Else DBoard.Cells(5, 4) = "No"
If CboxRow6.Value = True Then DBoard.Cells(6, 4) = "Yes" Else DBoard.Cells(6, 4) = "No"
If CboxRow7.Value = True Then DBoard.Cells(7, 4) = "Yes" Else DBoard.Cells(7, 4) = "No"
If CboxRow8.Value = True Then DBoard.Cells(8, 4) = "Yes" Else DBoard.Cells(8, 4) = "No"
I do this around 60 times - I have another worksheet module that tracks the sheet changes which is why there is an Application.EnableEvents line. I'm using 2016.
Anyone ideas out there. Anything is greatly appreciated
Private Sub UpdateTable()
Dim DBoard As Worksheet
Dim CBoxRow As Long
Dim TrackerOff As String
Set DBoard = ThisWorkbook.Sheets("Woodside Dashboard")
Application.ScreenUpdating = False
Application.Calculation = xlManual
Application.EnableEvents = False
If CboxRow4.Value = True Then DBoard.Cells(4, 4) = "Yes" Else DBoard.Cells(4, 4) = "No"
If CboxRow5.Value = True Then DBoard.Cells(5, 4) = "Yes" Else DBoard.Cells(5, 4) = "No"
If CboxRow6.Value = True Then DBoard.Cells(6, 4) = "Yes" Else DBoard.Cells(6, 4) = "No"
If CboxRow7.Value = True Then DBoard.Cells(7, 4) = "Yes" Else DBoard.Cells(7, 4) = "No"
If CboxRow8.Value = True Then DBoard.Cells(8, 4) = "Yes" Else DBoard.Cells(8, 4) = "No"
I do this around 60 times - I have another worksheet module that tracks the sheet changes which is why there is an Application.EnableEvents line. I'm using 2016.
Anyone ideas out there. Anything is greatly appreciated