Glasgowsmile
Active Member
- Joined
- Apr 14, 2018
- Messages
- 280
- Office Version
- 365
- Platform
- Windows
I've got this formula but keep getting a run time error (Application-defined or object-defined error). I've read about the error a few times but I don't understand what's causing the problem.
It's just a checkbox and I want to replace the formula used based on the status of the checkbox.
It's just a checkbox and I want to replace the formula used based on the status of the checkbox.
VBA Code:
Private Sub CheckBox1_Click()
If Range("$E$39") = "True" Then
Range("F44").Formula = "=XLOOKUP($B44,Data!$M:$M,Data!R:R)"
Else
Range("F44:F45").Formula = "=IFERROR(XLOOKUP($B44,Data!$M$3:$M$101,Data!R:R),"")"
End If
End Sub