Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default date find using find method



there are dates in Column A.
dateTest
2005-04-02
2005-04-17
2005-07-08
2005-12-11

then, i want to find 2005 and april only.
thus i coding below.
sub test()
set rFnd = range(cells(1),cells(1).end(xldown))
set cFnd = r.find("2005-04",r(1),xlformulas,2)
end sub

but cFnd have nothing..... why, why....????
help me.

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default date find using find method

Hi,
This worked OK for me:

Sub findDates()
With Worksheets(1).Range("a1:a5")
Set c = .Find("2005-04", LookIn:=xlValues, Lookat:=xlPart)
If Not c Is Nothing Then
firstAddress = c.Address
Do
MsgBox c.Row
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With

End Sub

"x taol" wrote:



there are dates in Column A.
dateTest
2005-04-02
2005-04-17
2005-07-08
2005-12-11

then, i want to find 2005 and april only.
thus i coding below.
sub test()
set rFnd = range(cells(1),cells(1).end(xldown))
set cFnd = r.find("2005-04",r(1),xlformulas,2)
end sub

but cFnd have nothing..... why, why....????
help me.

*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default date find using find method


no, the source do not work.
currently , i use excel 2000.


*** Sent via Developersdex http://www.developersdex.com ***
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
Using variables to make a date and using find method to find that. KyWilde Excel Programming 2 April 21st 05 09:43 PM
? Find method David Excel Programming 0 October 26th 04 03:39 PM
Find method benb Excel Programming 0 September 22nd 04 10:17 PM
Find method example Shinichi Excel Programming 3 August 22nd 03 10:39 PM
The Find Method Brad[_7_] Excel Programming 0 July 16th 03 03:23 PM


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