Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with speeding up vlookup macro

I am working on a macro to compare two lists of job numbers in two
separate workbooks. If there are any matches, those duplicate jobs are
flagged. I used vlookup to accomplish this. My problem is that my
table_array could have as many as 10000 cells. When I use vlookup to
check 200 different lookup_values, the processing time is, to say the
least, massive.

Is there any way to speed up this process? I had thought of sorting the

table_array, since there are a lot of blank cells in it. I guess my
main question is, how would I have one workbook sort a column in
another workbook?


Any help would be appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Help with speeding up vlookup macro

Sub ShippedWIP()
Columns("k:k").Select
Selection.Insert Shift:=xlToRight
Range("B26").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 9).Select
ActiveCell.FormulaR1C1 = "1"
Range("k26").Select
ActiveCell.FormulaR1C1 =
"=VLOOKUP(RC[-9],'[crViewer.xls]Sheet1'!R1C2:R1000C2,0,FALSE)"
Range("k26").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.FillDown
Columns("k:k").EntireColumn.AutoFit
Range("k26").Select
Do Until IsEmpty(ActiveCell) = True
If ActiveCell = CVErr(xlErrValue) Then
ActiveCell.Offset(0, -3).Select
Range(Selection, Selection.End(xlToLeft)).Select
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
ActiveCell.Offset(1, 10).Select
Else: ActiveCell.Offset(1, 0).Select
End If
Loop
Columns("k:k").Select
Selection.EntireColumn.Hidden = True
End Sub

I wanted to do this with a sql query, but I am a relative beginner at
vba/excel. Also, the IT department's backlog is pretty long, so I can't
get the proper command lines from them. Instead, I keyed off vlookup
and its associated errors. #Value indicates a match. I have already
proven that with many runs of my macro. It just takes forever!

ducky wrote:
wrote:
I am working on a macro to compare two lists of job numbers in two
separate workbooks. If there are any matches, those duplicate jobs are
flagged. I used vlookup to accomplish this. My problem is that my
table_array could have as many as 10000 cells. When I use vlookup to
check 200 different lookup_values, the processing time is, to say the
least, massive.

Is there any way to speed up this process? I had thought of sorting the

table_array, since there are a lot of blank cells in it. I guess my
main question is, how would I have one workbook sort a column in
another workbook?


Any help would be appreciated.


Please post your code so we can look at it and offer suggestions. One
thing i can say right now though is to investivge
application.screenupdating = false

AR


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
Need help speeding this up KD[_5_] Excel Programming 0 March 24th 06 05:17 PM
Speeding up a Data Validation macro Ryan[_11_] Excel Programming 2 June 28th 05 03:29 AM
help with speeding this up... Simon Excel Programming 16 April 26th 05 03:25 AM
speeding up vlookup Lolly[_2_] Excel Programming 2 February 16th 05 03:00 PM
speeding up a macro Brenda[_5_] Excel Programming 4 August 21st 03 12:56 AM


All times are GMT +1. The time now is 02:14 PM.

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"