LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default For Next does not find dates?


Hi Group,

Have problem with the code below. LookupRng1 and LookupRng2
are columns with dates formatet as YYYY-MM-DD. When running
the code the result is that no dates are found.

Any hint on whats wrong are welcomed.

Brgds

CG Rosen

--------------------------------------------------------
Dim LookupRng1 As Range
Dim LookupRng2 As Range
Dim cCell As Range
Dim a As Long

For Each cCell In LookupRng1

a = 0

With LookupRng2

Set j = .Find(cCell, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows)

If Not j Is Nothing Then
firstAddress = j.Address
Do

a = a + 1

Set j = .FindNext(j)
Loop While Not j Is Nothing And j.Address < firstAddress

End If

Msgbox a

End With

Next cCell



 
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
compare 2 tables of dates to find the preceding dates Babi Excel Worksheet Functions 3 October 28th 08 05:52 AM
FIND and dates Molly Excel Worksheet Functions 1 June 30th 08 09:44 PM
find dates between in excel MDI Anne Excel Discussion (Misc queries) 7 June 4th 07 06:25 PM
How do I find the earliest dates in a range of dates? JJ Excel Worksheet Functions 3 May 16th 06 09:36 AM
Using Find with dates Bert[_2_] Excel Programming 1 January 21st 05 03:52 PM


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