Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA: Look-Up Cell Date From User Input Box and return ALL matches


I'm looking for a look-up solution for a worksheet.

My worksheet column 68 contains dates. I need to figure out how t
code the following scenario:

The end user enters a date into an input box:
dtReportDate = (Date:=strReportDate).

I want to display ALL matching dates in another worksheet("To Do List"
to create a report. Im assuming I will need some kind of a Loo
Statement or For Each statement.

Can anyone help me out?

Thanks

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default VBA: Look-Up Cell Date From User Input Box and return ALL matches

Maybe some ideas (untested and may contain typos!):

dim dtReportDate as date
dim myCell as range
dim myRng as range
dim oRow as long

'''
if isdate(strreportdate) then
dtreportdate =cdate(strReportdate)
else
msgbox "not a date"
exit sub
end if

'''
with worksheets("sheet1withdates")
set myrng = .range(.cells(1,68),.cells(.rows.count,68).end(xlu p))
end with

orow = 0
for each mycell in myrng.cells
if mycell.value = dtreportdate then
orow = orow + 1
with worksheets("to do list").cells(orow,"A")
.value = mycell.value
.offset(0,1).value = mycell.offset(0,3).value 'whatever???
end with
next mycell

Just a note about your previous posts compared to this one.

When the question is narrow, you have a much better chance of getting a
response. Isolating just one little portion is a lot less intimidating for most
responders (well, at least for me!).


Mcasteel wrote:

I'm looking for a look-up solution for a worksheet.

My worksheet column 68 contains dates. I need to figure out how to
code the following scenario:

The end user enters a date into an input box:
dtReportDate = (Date:=strReportDate).

I want to display ALL matching dates in another worksheet("To Do List")
to create a report. Im assuming I will need some kind of a Loop
Statement or For Each statement.

Can anyone help me out?

Thanks.

--
Mcasteel
------------------------------------------------------------------------
Mcasteel's Profile: http://www.excelforum.com/member.php...o&userid=15698
View this thread: http://www.excelforum.com/showthread...hreadid=277143


--

Dave Peterson
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
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
Can vlookup return multiple matches in a single cell? cchristensen Excel Discussion (Misc queries) 3 December 2nd 04 01:56 AM
User input in cell Sean Excel Programming 3 October 29th 04 08:17 PM
jumping to a cell which matches user specified text bikestlr Excel Programming 3 December 10th 03 03:15 AM


All times are GMT +1. The time now is 01:42 AM.

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"