nomadelement
New Member
- Joined
- Apr 26, 2012
- Messages
- 14
Hello,
I am having some serious difficulty getting a row in my sheet to recalculate. I am using VBA to have check boxes hide and unhide rows, then a module to calculate the sum of only the visible rows. The problem is that once I click check boxes (hide / unhide rows) the formula to sum the visible rows will not recalculate and gives an error. I have tried all of the following VBA instructions inserted as the example below. The only instruction which works is "Application.CalculateFullRebuild" however this is a big sheet and that calculation takes a few minutes. I know there is apparently no way to calculate a full rebuild of a active sheet, so I am desperate for any ideas on how to get this a. active sheet. b. row. or c. individual cells to automatically fully recalculate everytime a checkbox is clicked.
Working (but not efficient) solution:
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
[6:6].EntireRow.Hidden = False
Else: [6:6].EntireRow.Hidden = True
Application.CalculateFullRebuild (Application.CalculateFull also works)
End If
End Sub
Just in case it helps you the row i need updated is row 11 columns F:K
Other things I have tried and failed with:
ActiveSheet.calculate
Worksheet(1).Calculate
I have also tried many variations on instructions to calculate specific rows / columns, however I will not write everything just in case I did something wrong I still would like to hear your thoughts.
I am having some serious difficulty getting a row in my sheet to recalculate. I am using VBA to have check boxes hide and unhide rows, then a module to calculate the sum of only the visible rows. The problem is that once I click check boxes (hide / unhide rows) the formula to sum the visible rows will not recalculate and gives an error. I have tried all of the following VBA instructions inserted as the example below. The only instruction which works is "Application.CalculateFullRebuild" however this is a big sheet and that calculation takes a few minutes. I know there is apparently no way to calculate a full rebuild of a active sheet, so I am desperate for any ideas on how to get this a. active sheet. b. row. or c. individual cells to automatically fully recalculate everytime a checkbox is clicked.
Working (but not efficient) solution:
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
[6:6].EntireRow.Hidden = False
Else: [6:6].EntireRow.Hidden = True
Application.CalculateFullRebuild (Application.CalculateFull also works)
End If
End Sub
Just in case it helps you the row i need updated is row 11 columns F:K
Other things I have tried and failed with:
ActiveSheet.calculate
Worksheet(1).Calculate
I have also tried many variations on instructions to calculate specific rows / columns, however I will not write everything just in case I did something wrong I still would like to hear your thoughts.