Sam_Manerker
New Member
- Joined
- Aug 1, 2017
- Messages
- 6
Hello everyone !
basically need some help figuring out why this is not working like it should. will try and give a brief overview first.
want to check if a company renewal date is due and alert accordingly on opening of workbook. have put down code that i'm using as under :
Sub Workbook_Open() '(company name-b2:b17 and date-u2:u17 (range working with right now))
Dim bottomD As Integer
bottomD = Range("u" & Rows.Count).End(xlUp).Row
Dim c As Range
For Each c In Range("u2:u" & bottomD) ' i think this is the problematic line of code. (??)
If c >= Date And c <= Date + 3 Then
MsgBox c.Offset(0, -19) & " is due in " & c - Date & " days." '
End If
Next c
End Sub
It seems to work only on a few rows but others are neglected. I cant figure out why that's happening....
I got this code off the net to be honest and tweaked it a bit ! am not an expert in this by any means..
Any help will be greatly appreciated !! Thanks in advance guys !
basically need some help figuring out why this is not working like it should. will try and give a brief overview first.
want to check if a company renewal date is due and alert accordingly on opening of workbook. have put down code that i'm using as under :
Sub Workbook_Open() '(company name-b2:b17 and date-u2:u17 (range working with right now))
Dim bottomD As Integer
bottomD = Range("u" & Rows.Count).End(xlUp).Row
Dim c As Range
For Each c In Range("u2:u" & bottomD) ' i think this is the problematic line of code. (??)
If c >= Date And c <= Date + 3 Then
MsgBox c.Offset(0, -19) & " is due in " & c - Date & " days." '
End If
Next c
End Sub
It seems to work only on a few rows but others are neglected. I cant figure out why that's happening....
I got this code off the net to be honest and tweaked it a bit ! am not an expert in this by any means..
Any help will be greatly appreciated !! Thanks in advance guys !