Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Faastest way to find last previous entry?
(In Excel 2003) When my user selects an item from a drop-down on a
UserForm, I need to search through the range of cells on the worksheet to find the last previous entry of that item. The item will probably be entered multiple times, so I need the one closest to the bottom of the list. Would it be faster to use a MATCH or LOOKUP function? Or do a Find? Iteration is probably the slowest, especially when this thing hits a few thousand entries, yes? Ed |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Faastest way to find last previous entry?
Hi
Find is probably the fastest. To find the last entry matching "grp" in column A Set lastCell = Range("A:A").Find("grp", SearchDirection:=xlPrevious) This will search backwards from A1 and hence find the last cell with "grp" in first. regards Paul On Feb 26, 1:47*pm, Ed from AZ wrote: (In Excel 2003) *When my user selects an item from a drop-down on a UserForm, I need to search through the range of cells on the worksheet to find the last previous entry of that item. *The item will probably be entered multiple times, so I need the one closest to the bottom of the list. Would it be faster to use a MATCH or LOOKUP function? *Or do a Find? Iteration is probably the slowest, especially when this thing hits a few thousand entries, yes? Ed |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Faastest way to find last previous entry?
Thanks, Paul. I appreciate the boost.
Ed On Feb 26, 7:30*am, wrote: Hi Find is probably the fastest. To find the last entry matching "grp" in column A * *Set lastCell = Range("A:A").Find("grp", SearchDirection:=xlPrevious) This will search backwards from A1 and hence find the last cell with "grp" in first. regards Paul On Feb 26, 1:47*pm, Ed from AZ wrote: (In Excel 2003) *When my user selects an item from a drop-down on a UserForm, I need to search through the range of cells on the worksheet to find the last previous entry of that item. *The item will probably be entered multiple times, so I need the one closest to the bottom of the list. Would it be faster to use a MATCH or LOOKUP function? *Or do a Find? Iteration is probably the slowest, especially when this thing hits a few thousand entries, yes? Ed- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
repeat entry from previous column | Excel Worksheet Functions | |||
check for previous entry | New Users to Excel | |||
restricting entry into a cell based on entry to a previous cell | New Users to Excel | |||
Check for previous entry | Excel Programming | |||
How to "repeat previous entry" ? | Excel Worksheet Functions |