Hi all,
Before I go to my question, I have to say I have no experience in coding. So, whatever I do is the result from search and asking.
Let me explain my case. I have an excel file with multiple hyperlinks (they actually are the page of a protein database). What my goal is to check each of the pages if they contain some keywords and have them recorded on my excel file (see below screenshoot).
So, for instance I want to know whether or not the Keywords on the headings M:T are present in each of the links. As I'm not experienced, the way I was trying to do it is by opening the webpage and copy the entire HTML, paste it into to the L column (by F2 and paste) and then the formulae for the keywords will search. I made the following (messy) code that does the job partially:
Sub Test1()
Dim x As Integer
For x = 2 To 3
Shell "explorer.exe " & Cells(x, 12).Text
Application.Wait (Now + TimeValue("0:00:04"))
Application.SendKeys ("^u")
Application.Wait (Now + TimeValue("0:00:01"))
Application.SendKeys ("^a")
Application.Wait (Now + TimeValue("0:00:01"))
Application.SendKeys ("^c")
Application.Wait (Now + TimeValue("0:00:01"))
Application.SendKeys ("%{TAB}")
Application.Wait (Now + TimeValue("0:00:01"))
Cells(x, 13).Select
Application.Wait (Now + TimeValue("0:00:05"))
Application.SendKeys ("{F2}")
Application.Wait (Now + TimeValue("0:00:05"))
Application.SendKeys ("^v")
Application.Wait (Now + TimeValue("0:00:05"))
Application.SendKeys ("^{ENTER}")
Application.Wait (Now + TimeValue("0:00:05"))
Next x
End Sub
Display More
The code works when I run it for one cell. But when I do the loop to run automatically to every link, it pastes only the last webpage's HTML (like skipping to paste the others in between no matter if I change the waiting time).
I know that's a not appropriate way to do it but that's the only way I could anyway.
Please, give me some advise/help as it drives me crazy!!!
THanks in advance,
George.