dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,352
- Office Version
- 365
- 2016
- Platform
- Windows
I have this code that needs to run when the spreadsheet is opened. It is an excel table inserted using the insert - table function and I have a check box that is meant to add 10% on to the total of a row if it is needed.
Why won't it work?
I currently have this code that works once the check box is selected. What it does is it puts a 1 or a 1.1 into a hidden field in the table for that row and the formula in the total cell is multiplied by this cell. It won't work until you select the check box for the first time. What do I do to put a default 1 into the cell on form load?
Thanks,
Dave
Why won't it work?
Code:
Private Sub chkIncrease_Click()
If chkIncrease = True Then
ListObjects("NPSS_quote").ListColumns("10%Increase").DataBodyRange.Value = "1.1"
Else
ListObjects("NPSS_quote").ListColumns("10%Increase").DataBodyRange.Value = "1"
End If
End Sub
I currently have this code that works once the check box is selected. What it does is it puts a 1 or a 1.1 into a hidden field in the table for that row and the formula in the total cell is multiplied by this cell. It won't work until you select the check box for the first time. What do I do to put a default 1 into the cell on form load?
Thanks,
Dave
Last edited: