Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default xls vba find method to find row that contains the current date

The find should get a match. I think I finally found the issue but not sure
best way to correct it. The FindDate is "03/26/2007" but the xls Date value
is showing up as "3/26/2007" and therefore no match. Any suggestions??
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default xls vba find method to find row that contains the current date

FindDate = "*" & Format$(Date, "m/dd/yyyy")
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"RCranston"
wrote in message
The find should get a match. I think I finally found the issue but not sure
best way to correct it. The FindDate is "03/26/2007" but the xls Date value
is showing up as "3/26/2007" and therefore no match. Any suggestions??
Thanks!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default xls vba find method to find row that contains the current date

I will try the following: FindDate = "*" & Format$(Date, "m/dd/yyyy")
Is the "m/dd/yyyy" format for both single digit and double digits months.

And what about single digit and double digits days?
The FindDate could be "11/01/2007" but the xls date would be "11/1/2007"??


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default xls vba find method to find row that contains the current date

Sub ThereIsAlwaysAnotherWay()
Dim dblFind As Double
Dim ws As Worksheet
Dim rng As Range
Dim vRow As Variant

Set ws = Worksheets("Daily Sched")
Set rng = ws.Columns("A:A").Cells
dblFind = CDbl(Date)

vRow = Application.Match(dblFind, rng, 0)
If IsError(vRow) Then
vRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Offset(1, 0).Row
End If
MsgBox vRow
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"RCranston"
wrote in message
I will try the following: FindDate = "*" & Format$(Date, "m/dd/yyyy")
Is the "m/dd/yyyy" format for both single digit and double digits months.

And what about single digit and double digits days?
The FindDate could be "11/01/2007" but the xls date would be "11/1/2007"??


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
Find the date of the coming up Saturday given the current date. Michael Ermino Excel Worksheet Functions 4 April 11th 07 02:48 AM
date find using find method x taol Excel Programming 2 December 22nd 05 09:51 AM
Function to find row with most current date malik641 Excel Worksheet Functions 3 June 23rd 05 07:05 PM
Using variables to make a date and using find method to find that. KyWilde Excel Programming 2 April 21st 05 09:43 PM
Using Find method wade Excel Programming 3 March 3rd 04 07:05 AM


All times are GMT +1. The time now is 07:55 AM.

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"