Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
compare 2 tables of dates to find the preceding dates | Excel Worksheet Functions | |||
FIND and dates | Excel Worksheet Functions | |||
find dates between in excel | Excel Discussion (Misc queries) | |||
How do I find the earliest dates in a range of dates? | Excel Worksheet Functions | |||
Using Find with dates | Excel Programming |