List Info

Thread: Search for dates




Search for dates
user name
2006-11-29 21:48:10
 
Hi all, (I have posted this to one other Group
excel/VBA@yahoogroups.com Aswell) 
 
I hope some one can help with this I have a spreadsheet
which I keep
track of all jobs we do, I have  code to find all the jobs
by certain
customers which works fine but now I am trying to add to
this code so
that I can search for jobs (Before, On, or After) A date and
ignore
all the rest, but my code doesn't seem to work it still
copies all
jobs by which ever customer I choose can someone please
point me in
the right direction as to where I am going WRONG!!!.
 
 
 
Dim rngDate As Range 'Column A all dates
'Sheet search is where all records found are copied to
Sheets("Search").Range("A2:M1000").Delet
e Shift:=xlUp
 
 
    'loop through column a looking for all records before
(frmsearch.txtdate.value)date
    For Each rngDate In
Sheets("Skips").Range("A:A")
        If IsDate(rngDate) Then
        'if the date in column A is less than the date in
the textbox
on the form
           If rngDate.Value <= frmSearch.txtDate.Value
Then
        'If the date is less then check to see if the name
in column B
is the same as frmSearch.txtSearch
            If UCase(rngDate.Offset(0, 1)) =
UCase(frmSearch.txtsearch) Then
            'If it is then copy it to the search sheet
            RngDate.EntireRow.Copy
Destination:=Sheets("Search") _
            .Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
            End If
           End If
        End If
    Next rngDate
 
 
 
Thank you 
 
Alan 
  
   
 




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://grou
ps.yahoo.com/group/helpwithvb/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://
groups.yahoo.com/group/helpwithvb/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:helpwithvb-digest@yahoogroups.com 
    mailto:helpwithvb-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    helpwithvb-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )