I have a webpage and need my code to copy the entire data from the page and copy it into the excel sheet, which is not happening right now. My excel sheet is coming to be completely blank. I think the ^a
feature is not working on the IE to select the data and then copy it.
Any help is much appreciated. Below is the code I am using.
Sub Webdata()
Dim assetname As String, country As String, area As String, region As String, pth As String, folname As Variant, assetname1 As String
Website = "http://website.com/"
Set myIE = CreateObject("InternetExplorer.Application")
myIE.Navigate source
myIE.Visible = True
Application.Wait Now + TimeSerial(0, 0, 10)
SendKeys "^a"
Application.Wait Now + TimeSerial(0, 0, 2)
SendKeys "^c"
Application.Wait Now + TimeSerial(0, 0, 2)
Sheets.Add
ActiveSheet.Name = "Webdata"
ActiveSheet.Paste
Application.Wait Now + TimeSerial(0, 0, 2)
Range("A1").Select
Cells.Find(What:="Api Number", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(1, 0).Select
Selection.Copy
Sheets("Sheet1").Activate
Range("C2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
myIE.Quit
Set myIE = Nothing
Err.Clear
Sheets("Webdata").Select
ActiveSheet.Delete
End Sub