Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello! I have a small problem that I do not know exactly how to solve. I have a macro that that searches a list in Excel for a certain date e.g. 2006-02-14. The date is stored in the array strSlutDatumArray(1). I look using rng(1).Offset(j, 0) (never mind that but it just loops down in a list). I apply this code on many lists. Almost all lists consist of dates based on a 5 day week. However some lists only contain one date per week. Assume that I am searching for the date 2006-01-10. The lists contain only 1 date per week. I want to somehow check so that I choose the date closest to 2006-01-10 in the list. Assume that the list looks like: 2006-01-01 2006-01-08 2006-01-15 Then I want to stop my search at the date closest to 2006-01-10, i.e. 2006-01-08. Can anyone help me with how to do that? Any help is very much appreciated! Thanks a lot in advance! The code I am using for searching the list is: Do Until IsEmpty(rng(1).Offset(j, 0)) = True Or rng(1).Offset(j, 0).text = strSlutDatumArray(1) = True j = j + 1 Loop |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help! Find Closest Coordinate Match | Excel Discussion (Misc queries) | |||
Find number closest to 0 | Excel Discussion (Misc queries) | |||
Array Lookup to Find Closest Date and Next Closest Date | Excel Worksheet Functions | |||
Find closest match and copy | Excel Discussion (Misc queries) | |||
How do I find a column entry closest to a particular value | Excel Worksheet Functions |