Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding multiple occurances of a date within one column: Should be easy?


I'm having a hard time returning multiple dates from
worksheet("Customer Enrollment") column(68) to a seperate worksheet("T
Do List").

The User inputs the date he/she is looking for into an input bo
(strReportDate), later converted to "dtReportDate".

I WANT TO RETURN ALL OCCURANCES OF THE MATCHING DATE FROM COLUMN 68.
WHEN EACH MATCHING DATE IS RETURNED ID ALSO WANT TO INCLUDE TH
CORROSPONDING NAME FROM COLUMN 67 TO THE NEW WORKSHEET (TO DO LIST)

I can handle returning the name's, but Im not sure how to retur
multiple matching dates from column 68.



*Column 68 * (Dates from worksheet("Customer Enrollment")
-----------------------------------------------------------------------------------
10/23/2004 (these are date values in the spreadsheet)
10/25/2004
11/01/2004
11/01/2004
11/01/2004
11/02/2004
11/04/2004
11/04/2004
11/05/2004
11/05/2004
11/07/2004

Column 67 (Also from Sheet "Customer Enrollment") (2nd Priority)
----------------------------------------------------------------------------------
Name1
Name2
Name2
Name3
Name4
Name1
Name3
Name6
Name4
Name4
Name5



Can anyone help to guide me through this, Ive been beating myself u
over this one for a couple of days.

Thank you.

Mike

===============================================
_Sample_of_what_I_would_like_to_return:_

if seaching for date: 11/01/2004 Return:

11/01/2004 Name2
11/01/2004 Name3
11/01/2001 Name4

if seaching for Date: 11/05/2004 return:

11/05/2004 Name4
11/05/2004 Name

--
Mcastee
-----------------------------------------------------------------------
Mcasteel's Profile: http://www.excelforum.com/member.php...fo&userid=1569
View this thread: http://www.excelforum.com/showthread.php?threadid=27743

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Finding multiple occurances of a date within one column: Should be easy?

Sub CopyDates()
Dim rng As Range, cell As Range
Dim dtReportDate As Date
Dim strReportDate
strReportDate = InputBox("Enter date")
If IsDate(strReportDate) Then
dtReportDate = CDate(strReportDate)
Else
Exit Sub
End If
With Worksheets("Customer Enrollment")
Set rng = .Range(.Cells(1, 68), .Cells(Rows.Count, 68).End(xlUp))
End With
For Each cell In rng
If cell.Value2 = CLng(dtReportDate) Then
cell.Offset(0, -1).Resize(1, 2).Copy _
Destination:=Worksheets("To Do List") _
.Cells(Rows.Count, 1).End(xlUp)(2)
End If
Next
End Sub

Untested pseudocode.
--
Regards,
Tom Ogilvy






"Mcasteel" wrote in message
...

I'm having a hard time returning multiple dates from a
worksheet("Customer Enrollment") column(68) to a seperate worksheet("To
Do List").

The User inputs the date he/she is looking for into an input box
(strReportDate), later converted to "dtReportDate".

I WANT TO RETURN ALL OCCURANCES OF THE MATCHING DATE FROM COLUMN 68.
WHEN EACH MATCHING DATE IS RETURNED ID ALSO WANT TO INCLUDE THE
CORROSPONDING NAME FROM COLUMN 67 TO THE NEW WORKSHEET (TO DO LIST).

I can handle returning the name's, but Im not sure how to return
multiple matching dates from column 68.



*Column 68 * (Dates from worksheet("Customer Enrollment")
--------------------------------------------------------------------------

---------
10/23/2004 (these are date values in the spreadsheet)
10/25/2004
11/01/2004
11/01/2004
11/01/2004
11/02/2004
11/04/2004
11/04/2004
11/05/2004
11/05/2004
11/07/2004

Column 67 (Also from Sheet "Customer Enrollment") (2nd Priority)
--------------------------------------------------------------------------

--------
Name1
Name2
Name2
Name3
Name4
Name1
Name3
Name6
Name4
Name4
Name5



Can anyone help to guide me through this, Ive been beating myself up
over this one for a couple of days.

Thank you.

Mike

===============================================
_Sample_of_what_I_would_like_to_return:_

if seaching for date: 11/01/2004 Return:

11/01/2004 Name2
11/01/2004 Name3
11/01/2001 Name4

if seaching for Date: 11/05/2004 return:

11/05/2004 Name4
11/05/2004 Name4


--
Mcasteel
------------------------------------------------------------------------
Mcasteel's Profile:

http://www.excelforum.com/member.php...o&userid=15698
View this thread: http://www.excelforum.com/showthread...hreadid=277431



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
finding multiple non-zero values in a column ij00mini Excel Worksheet Functions 2 February 19th 08 11:21 PM
finding multiple non-zero values in a column ij00mini Excel Worksheet Functions 2 January 29th 08 02:55 PM
Count multiple occurances in a column DTTODGG Excel Worksheet Functions 7 November 15th 05 05:59 PM
Finding the most frequent occurances Bear Excel Discussion (Misc queries) 4 November 7th 05 06:32 PM
Stack multiple columns into one column... is there an easy way? Julian Excel Discussion (Misc queries) 2 September 16th 05 07:31 PM


All times are GMT +1. The time now is 07:49 PM.

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

About Us

"It's about Microsoft Excel"