# Time is up

#### Ralph M

##### Active Member
I have a spread sheet with a date for each day of the year in Col "A"
IE: Row 1 01/01/02, Row 2 01/02/02, ETC.
I have in Column Q "Occurences" which are entered as 1, in Column R, I have an If Function that says "If Q10 is > 0 Then A10 + 60, (This counts out 60 days from the date it was entered) at which time I want to remove the occurence with a -1 to take it away. I have entered a "0" in the "Occurence" Column as a reminder on the date (60 days) it is to be removed. What I want to do is have the program when it opens look at column Q and if there is a "0" and the date is => the date in Col "A",(on the 60th day), Display a MsgBox as a reminder to remove the Occurence. All I need help with is how to write the code for "If Col Q = 0 Then.... look at column "A" and see if it's => the today's date.

### Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

#### Barrie Davidson

##### MrExcel MVP
Ralph, would this work for you?

<PRE>
Dim ZeroOccurrences As Long

ZeroOccurrences = Application.WorksheetFunction.CountIf(Range("Q:Q"), "=0")
If ZeroOccurrences <> 0 Then
MsgBox ("Remember to remove occurences with value of zero")
End If

</PRE>

Regards,

#### Ralph M

##### Active Member
Barrie,
I need it to check Column Q for the "0", but I also need it to check for the date in Column A to see if it's >= Today.

#### Barrie Davidson

##### MrExcel MVP
Do you have any information in column R or can I use it for the macro?

#### Ralph M

##### Active Member
Barrie,
In my posting I explained that I am using R for the date in column A + 60 days.

#### Barrie Davidson

##### MrExcel MVP
What column could I use (needs to be blank)?

Replies
6
Views
198
Replies
13
Views
710
Replies
11
Views
210
Replies
5
Views
245
Replies
33
Views
2K

1,181,538
Messages
5,930,479
Members
436,741
Latest member
buckeyerich

### 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.

### Which adblocker are you using?

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

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