Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default code that searches for current date

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default code that searches for current date

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" wrote in message
ups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default code that searches for current date

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default code that searches for current date

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" wrote in message
ups.com...
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
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
Current Date Code in form Tony Excel Discussion (Misc queries) 11 September 21st 09 04:12 PM
Getting valid web searches and avoiding sites that contaminate web searches David McRitchie New Users to Excel 1 June 13th 06 03:00 AM
code an input field that asks for current date jaggyone Excel Programming 1 November 28th 05 07:56 AM
Can I add the current date/time to my code when I print it? Dave F.[_3_] Excel Programming 2 September 14th 04 09:23 AM
code pasting a date changes date format in current month only Edward[_5_] Excel Programming 0 May 10th 04 06:13 PM


All times are GMT +1. The time now is 05:47 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"