PC Review


Reply
Thread Tools Rate Thread

code that searches for current date

 
 
J.W. Aldridge
Guest
Posts: n/a
 
      3rd Oct 2007
tyring to get a code that searches column F for the very first
instance of the current date (i.e. 10/3) and stops on that cell

 
Reply With Quote
 
 
 
 
Bernie Deitrick
Guest
Posts: n/a
 
      3rd Oct 2007
Range("F:F").Find(Format(Now(), Range("F2").NumberFormat), , xlValues).Select

This assumes that the formatting is consistent down column F, and F2 contains a date...

HTH,
Bernie
MS Excel MVP


"J.W. Aldridge" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> tyring to get a code that searches column F for the very first
> instance of the current date (i.e. 10/3) and stops on that cell
>



 
Reply With Quote
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      3rd Oct 2007
Sub findit()
n = Cells(Rows.Count, 6).End(xlUp).Row
td = Date
For i = 1 To n
If Cells(i, 6).Value = td Then
Cells(i, 6).Select
Exit Sub
End If
Next
End Sub

--
Gary''s Student - gsnu200748


"J.W. Aldridge" wrote:

> tyring to get a code that searches column F for the very first
> instance of the current date (i.e. 10/3) and stops on that cell
>
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      3rd Oct 2007
On Error Resume Next
iRow = Application.Match(Date,Columns(6),0)
On Error Goto 0
If iRow > 0 Then
...

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"J.W. Aldridge" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> tyring to get a code that searches column F for the very first
> instance of the current date (i.e. 10/3) and stops on that cell
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Current Date Code in form Tony Microsoft Excel Misc 11 21st Sep 2009 04:12 PM
VBA code relative to current date Jbm Microsoft Excel Programming 5 29th Jul 2009 06:43 PM
Keep date current Code in Word job Compare document don't show changes Microsoft Word Document Management 2 27th Feb 2009 01:04 PM
Can I add the current date/time to my code when I print it? Dave F. Microsoft Excel Programming 2 14th Sep 2004 09:23 AM
code pasting a date changes date format in current month only Edward Microsoft Excel Programming 0 10th May 2004 06:13 PM


Features
 

Advertising
 

Newsgroups
 


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