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

At a glance there could be loads of things wrong with your code, difficult
to tell as it is clearly incomplete. If your date format is International,
get working as best you can an test with similar non-date data. If it works
but it fails with dates post back.

Regards,
Peter T

"CG Rosén" wrote in message
...
Hi Nigel,

Thanks for reply. My mistake not to show that the ranges are set.
I guess the problem is with the dim statements?

brgds

CG Rosen


"Nigel" wrote in message
...
You do not appear to be setting the two ranges? If so the ranges are
empty, use something like...

Set LookupRng1 = Sheets("Sheet1").Range("A1:A100")



--

Regards,
Nigel




"CG Rosén" wrote in message
...

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 05:43 PM.

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"