Excel 如何单击enter以触发搜索

Excel 如何单击enter以触发搜索,excel,web,triggers,command,vba,Excel,Web,Triggers,Command,Vba,我想添加一段代码,在代码添加到搜索表单中后,自动按Enter键 url如下所示: 到目前为止我的代码(因为我在搜索框中看不到代码,所以它不起作用。) 选择,复制 IE.Document.getElementByid(“\u skeyword”).Value=ActiveCell.Value 我是一个非常新的编码,所以任何帮助将高度感谢 提前谢谢各位 当我们点击enter时,它只是通过导航到URL来获取请求。试试下面的代码 Sub SearchBook() Dim URL As Str

我想添加一段代码,在代码添加到搜索表单中后,自动按Enter键

url如下所示:

到目前为止我的代码(因为我在搜索框中看不到代码,所以它不起作用。)

选择,复制

IE.Document.getElementByid(“\u skeyword”).Value=ActiveCell.Value

我是一个非常新的编码,所以任何帮助将高度感谢


提前谢谢各位

当我们点击enter时,它只是通过导航到URL来获取请求。试试下面的代码

Sub SearchBook()

    Dim URL As String
    URL = "http://www.nook.com/gb/store/books"

    Dim bookname As String
    bookname = "visions trips and crowded rooms"


    Dim IE As Object
    Set IE = CreateObject("InternetExplorer.Application")
    IE.navigate URL
    IE.Visible = True


    Application.Wait Now + TimeSerial(0, 0, 5)
    MsgBox "Site will now search for book"

    IE.navigate "http://www.nook.com/gb/search?utf8=%E2%9C%93&%5Bs%5Dkeyword=" & bookname

End Sub

嗨,桑托什,谢谢你在这一次回到我身边。我试着做的是:Dim IE As Object Dim x As Integer Set IE=CreateObject(“InternetExplorer.Application”)IE.Navigate“IE.Visible=True apiShowWindow IE.hwnd,SW_MAXIMIZE,而IE.busy DoEvents Wend‘建立’For“循环到循环”numrows“次数”在这里,它转到我的excel文件,并将x=1的代码(ISBN)带到NumRows的Selects cell down活动单元格中的1行。Selection.Copy IE.Document.getElementByid(“\u skeyword”).Value=ActiveCell.Value Application.SendKeys“~”Application.Wait(现在+时间值(“00:00:01”))基本上我需要将ISBN放在搜索字段中,并自动触发Enter命令,这样我就可以转到书的页面。提前感谢您的耐心和时间!