PDA

View Full Version : [SOLVED:] condition error



RuneDefour
03-30-2023, 05:16 AM
I'm getting error 13 on this line, but I don't know why. do you know what to change.


If IsEmpty(Range("G:G")) Or Range("G:G").Value = 0 And Range("H:H").Value = False Then

arnelgp
03-30-2023, 05:22 AM
maybe you need to test each Cell on the range?

Paul_Hossler
03-30-2023, 05:24 AM
I'm getting error 13 on this line, but I don't know why. do you know what i need to change.

Don't think you can test an entire column like that

This works



Option Explicit

Sub test()
If IsEmpty(Range("G1:G1")) Or Range("G1:G1").Value = 0 And Range("H1:H1").Value = False Then
MsgBox 1
Else
MsgBox 2
End If
End Sub

Aussiebear
04-05-2023, 04:25 AM
Due to lack of interest in this thread by RuneDefour, I am going to close it.