I created a macro to retrieve data from a worksheet based on the contents of a cell within the same workbook. However, the macro runs slowly at first then gets slower. The workbook has several worksheets but I am only using 2. I import customer data into Sheets(1) and have my search data formatted as text - this is a column of numbers which I do not want to treat as numbers. The search numbers in Sheets(1) are a subset of the complete number in Sheets(2). For example, in Sheets(1), I use 062825 to search Sheets(2) to find 011874000061825. Numbers in both sheets are formatted as text.
I sort both sheets on the data value I am interested in then use a For..Next loop to grab each input value and search Sheets(2). I included a code fragment below for evaluation. All variables are initialized prior to For loop. At this time, Sheets(1) has 250 lines while Sheets(2) has approx 1357 lines.
Any comments will be appreciated.
Thank you
Gandalf2524
Bookmarks