Sub test()
Dim p&
For p = 1 To 5
Dim myQuery
With ActiveSheet
.Cells.Delete
.[a1] = "Conneting, Please Wait..."
Set myQuery = ActiveSheet.QueryTables _
.Add(Connection:="URL;
http://www.9310086.com/ydhao/index.asp?CityId=2&page=" & p, _
Destination:=.Cells(1, 1))
End With
With myQuery
.Refresh
End With
Next
End Sub
这个循环,结果只是显示出p=5的值,前面p=1-4的貌似都被覆盖了,求大神修改啊~