View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Anthony[_12_] Anthony[_12_] is offline
external usenet poster
 
Posts: 6
Default Ned to speed up my code

Although excel is very good, you might want to think about moving over to
something designed better for large amount of data, like for instance a
database e.g Access.

For the amount of infomaation you are ploughing through it will be slow, but
a few tweaks might help (but not much)

e.g simplify the if statements

If (c Is Nothing) Then
MsgBox Prompt:="There are no parts listed that match your search.",
buttons:=vbOKOnly

else If (Not c Is Nothing) Then
frmPartsList.lstParts.Visible = True
frmPartsList.lblPartNum.Visible = True
frmPartsList.lblPartNum2.Visible = True
frmPartsList.lblHCode.Visible = True
frmPartsList.lblHCode2.Visible = True
frmPartsList.lblPart.Visible = True
end if

also do the search for both parts at same time not one after the other. By
doing it the way you have you have just doubled the time required. Also look
at the assignments for the code, justs seems very long winded. wouldnt a
simple text and number check against cell values be easier and overall
quicker.

e.g

dim myrange as range

myrange=worksheets("data").cells(rows.count,"gm"). end(xlup).row

for each cell in myrange

etc.....
etc...

look for the simplest way is normally the best.

Anthony

wrote in message
oups.com...
Don,

Thanks for the tip. The table is 40k rows currently. I made the change
anyway. No chnage in performance. Have any other ideas?

-doodle