我想找到一个带有网页查询的一系列房间号码的本地名称 . 查询结果是基本表 . URL需要可变房间号 . 房间号码在sheet1 A1:A600网页查询将有一个目的地到sheet2找到sheet2中的单元格,字符串“Local Name”复制它下面的单元格并将其粘贴到旁边的单元格第一张表中的当前房号 . 如果发现错误或没有发现任何进入下一个房间号码

我有很少的vba经验,所以你能提供的任何帮助将不胜感激 .

这是我认为它会像:

Sub RoomName()    

Dim IE As Object ' InternetExplorer   
Dim roomNum As Range   
Dim localName As String       

Set IE = CreateObject("InternetExplorer.Application")   
    IE.Visible = False  

For Each roomNum In Range("A1:A600")

URL = "http://www.nonpublicsite.org/campusname" & roomNum &    

With IE
.Navigate URL

'open the url redirect results to sheet2  
'find string (Local Name) copy cell below the result and paste into sheet1 next to the current room number in the loop  

Sheets("Sheet2").Cells.ClearContents    

On Error Resume Next    
Next roomNum    
End Sub