Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

search column and display results in msgbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mike - 23 Jan 2008 01:28 GMT
Dear All,

Thank you in advance for any help that is provided.

Following on from some of my previous posts...
I have a sheet that contains names in Column C and Dates in Column N.
I would like to have a macro start on workbook open and search for today - 2
days in column N and then look at all cells in Column C which correspond to
the value.
I would then like to view these results in a msgbox.

Cheers,

mike
JLGWhiz - 23 Jan 2008 03:18 GMT
This might do it.

Private Sub Workbook_Open()
  Dim c As Range
  lr = Cells(Rows.Count, "N").End(xlUp).Row
  sDate = CDate(Format(Now - 2, "m/d/yy"))
  For Each c In Sheets(1).Range("N2:N" & lr)
     If c.Value = sDate Then
       MsgBox "Value in Column C for " & sDate & " is " & _
       Range("C" & c.Row).Value
     End If
  Next
End Sub

> Dear All,
>
[quoted text clipped - 10 lines]
>
> mike
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.