I want to add an IF statement to my macro that will run only if a cell on the worksheet is not blank (empty). I know how to use the if statements but can't figure out how to test a cell for contents.
Test If Cell is Empty or Blank
- TJE
- Closed
-
-
-
-
Re: If Statement Based On Cell Contents
I would try either:
[vba]IF Cell(x,y)=""[/vba]
Or
[vba]IF LEN(TRIM(cell(x,y))=0[/vba]WOuld either of these work?
-
Re: If Statement Based On Cell Contents
If you mean truly empty/blank use
-
Re: Test If Cell is Empty or Blank
That gives me what I need.
Thanks
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!