Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default search column and display results in msgbox

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default search column and display results in msgbox

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

"mike" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA code to search and display results in multicolumn listbox [email protected] Excel Programming 6 February 7th 07 01:32 AM
Search cells based on criteria and display results in a single col G Bonham Excel Discussion (Misc queries) 5 January 12th 07 03:19 PM
Search column for certain criteria and display results in a table cheeser83 Excel Programming 0 December 7th 06 04:34 PM
VB evaluate a value in a table's column and display msgbox AusTexRich Excel Discussion (Misc queries) 8 October 10th 05 10:23 PM
Showing Search results in msgbox? Ed[_9_] Excel Programming 1 August 28th 03 05:13 PM


All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"