AND condition with multiple OR condtions

kpasa

Board Regular
Joined
Nov 20, 2015
Messages
82
I'm trying to cycle through a table and pull specific rows with certain criteria. So let's say I have a row and I've activated the first cell in the row. In pseudo code here's what I need:

Code:
If ActiveCell < Today AND any of these conditions apply
ActiveCell.offset(0,1) is empty
ActiveCell.offset(0,2) is empty
ActiveCell.offset(0,3) is empty

'Then do some code.

How do I pair the AND condition with any one of the OR statements being true?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try:
Code:
    If ActiveCell < Today And (ActiveCell.Offset(0, 1) = "" Or ActiveCell.Offset(0, 2) = "" Or ActiveCell.Offset(0, 3) = "") Then
 
Upvote 0
Code:
    If ActiveCell < Today And (ActiveCell.Offset(0, 1) = "" Or ActiveCell.Offset(0, 2) = "" Or ActiveCell.Offset(0, 3) = "") Then

That's exactly what i needed. Thank you!
 
Upvote 0
Unless you are using it as a variable, Today is not a VBA function.

Code:
If ActiveCell < Date And (ActiveCell.Offset(, 1) = "" Or activcell.Offset(, 2) = "" Or ActiveCell.Offset(, 3) = "") Then
 
Upvote 0

Forum statistics

Threads
1,225,761
Messages
6,186,890
Members
453,383
Latest member
SSXP

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top