Extremely slow macro

C

CLR

Hi All...........

I have a macro that works fine, except it takes too long to
run......something like a couple of minutes. The thing that makes it slow
is the following line.........

Worksheets("BladesX1").Range("FieldBladesX1").Formula =
"=IF(ISNA(VLOOKUP(($C8&""_""&D$1&""_""&D$4),MasterNamefile!$B:$S,14,FALSE)),
"""",VLOOKUP(($C8&""_""&D$1&""_""&D$4),MasterNamefile!$B:$S,14,FALSE))"

It's all one line, the word-wrap is playing it here.........
The MasterNamefile sheet is a database of some 15,000 lines. The
FieldBladesX1 contains some 1000+ cells. I know it's doing a lot of work,
and it does exactly as it's supposed to, but is there any way to speed it up
any?

TIA
Vaya con Dios,
Chuck, CABGx3
 
R

Roger Govier

Hi Chuck

Maybe

"=IF(COUNTIF(MasterNamefile!$B:$B,$C8&""_""&D$1&""_""&D$4),
VLOOKUP(($C8&""_""&D$1&""_""&D$4),MasterNamefile!$B:$S,14,FALSE), """")"
 
C

CLR

Thanks Roger.........
I'll have to give it a try tomorrow.........for some reason I keep getting
"Out of memory" error tonight here on this machine when I try to go into the
VBE.........

Vaya con Dios,
Chuck, CABGx3
 
R

Roger Govier

Hi Chuck

Glad to have been of service.
Compensates just a little for all that I have gained from your postings
over the past few years!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top