Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default 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
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
repeat entry from previous column jdw Excel Worksheet Functions 1 January 30th 10 02:06 PM
check for previous entry MichaelCasper New Users to Excel 2 August 29th 08 11:36 PM
restricting entry into a cell based on entry to a previous cell newbie57 New Users to Excel 1 June 9th 08 05:43 PM
Check for previous entry Craig[_24_] Excel Programming 2 October 14th 05 02:24 AM
How to "repeat previous entry" ? fantasma Excel Worksheet Functions 9 December 10th 04 01:43 PM


All times are GMT +1. The time now is 11:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"