always_confused
Board Regular
- Joined
- Feb 19, 2021
- Messages
- 68
- Office Version
- 2016
- Platform
- Windows
Hello,
I am using the value selected in a combobox as a sort of filter, as in
However if ActiveSheet.OLEObjects("ComboBox1").Object.Value is not assigned, I'm dividing by nothing and that doesn't work. I have tried a bunch of combinations of Is Null, is Nothing etc, and I cannot figure out how to check if the value has been selected in the combobox before dividing by it.
Can anyone help me with the syntax here?
Thanks
I am using the value selected in a combobox as a sort of filter, as in
VBA Code:
If Range("A1")=ActiveSheet.OLEObjects("ComboBox1").Object.Value Then
Range("B1") = Range("A1").value/ ActiveSheet.OLEObjects("ComboBox1").Object.Value
However if ActiveSheet.OLEObjects("ComboBox1").Object.Value is not assigned, I'm dividing by nothing and that doesn't work. I have tried a bunch of combinations of Is Null, is Nothing etc, and I cannot figure out how to check if the value has been selected in the combobox before dividing by it.
Can anyone help me with the syntax here?
Thanks