Thread: Macro Problem
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
namenorg namenorg is offline
external usenet poster
 
Posts: 4
Default Macro Problem

I have a macro that seems to run exceptionally long and uses 100% of CPU. Is
there something wrong or is it just the website? Any help is appreciated.

Sub MacroKeep()
For xNum = 1 To 5
Var3 =
"URL;http://www.license.state.tx.us/ABProjectRegistrationOnline/ABProjectPrintConfirmationGeneral.aspx?strWhereURL =ABDataSearch&strProjNum=EABPRJ"
Var4 = ActiveSheet.Range("b" & xNum)
With ActiveSheet.QueryTables.Add(Connection:=Var3 & Var4,
Destination:=Range("a1"))
.WebFormatting = xlNone
.WebSelectionType = xlSpecifiedTables
.WebTables = "5"
.Refresh BackgroundQuery:=False
Range("a1:a5").Copy
Range("c" & xNum).PasteSpecial Transpose:=True
Range("a1:a5").ClearContents
End With
Next
End Sub