Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88854

Unable to copy data from another sheet to main sheet

$
0
0

to get the data from website in sheet2

Sub Button1_Click()

`strSearch = Range("a1")`
`With Sheet2.QueryTables.Add( _`
                 `Connection:="URL;https://iban.codes/validate/ "& strSearch & "&safe=active", _
                 `Destination:=Sheet2.Range("a5"))`

   `.BackgroundQuery = True` 
    .TablesOnlyFromHTML = True
    .Refresh BackgroundQuery:=False
    .SaveData = True
End With
Call copy
Application.ScreenUpdating = True
Sheet2.UsedRange.Delete
End Sub

to copy the data from sheet2 to sheet1

Sub copy()
        Sheets("Sheet2").Range("A5").copy Destination:=Sheets("Sheet1").Range("A5") 
 End Sub

Viewing all articles
Browse latest Browse all 88854

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>