MsgBox using cell references

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a column that is looking for Overdue dates, I want to have a MsgBox
that shows the detail in Column A and Column B how is it possible to do?

I will then put this into the Workbook_Open so that it will pop up when
report opens.

Thanks
 
Hi Jez

One way to do it would be

Option Explicit
Dim LastRow As Integer
Dim MyCell, MyRng As Range

Private Sub Workbook_Open()

With Sheets(1)

LastRow = [A65535].End(xlUp).Row

Set MyRng = Range("A1:A" & LastRow)

For Each MyCell In MyRng

If MyCell.Value < Date Then

MsgBox (MyCell.Value & vbNewLine & MyCell.Offset(0, 1).Value)

End If

Next MyCell

End With

End Sub


Hope this helps

S
 
Thanks Bob,

I thought of that but due to the importance of this info, I cant have users
looking for this type of data, I need it to show them when they open the
report.

So I need to show on a MsgBox Column A and Colum B if it is in either

Due in 2 Weeks
Due in 3 Weeks
Due This Month

Those are in Column B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top