Run this code !!! Regards, Mandeep baluja 


Sub Button1_Click()
Dim i As Integer, j As Integer, k As Integer, s As String
i = 1
j = 1
Do
  s = Cells(i, 4).Value
  If s = "" Then Exit Do
  Worksheets("DATA").Select
  Cells(j, 1) = Worksheets("URL").Cells(i, 1).Value
  Cells(j, 2) = Worksheets("URL").Cells(i, 2).Value
  Cells(j, 3) = Worksheets("URL").Cells(i, 3).Value
  On Error Resume Next
  With ActiveSheet.QueryTables.Add(Connection:= _
      "URL;" & s, Destination:=Range("D" & CStr(j)))
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingAll
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
  End With
  On Error GoTo 0
  For k = j + 1 To ActiveSheet.UsedRange.Rows.Count + 1
    Cells(k, 1) = Cells(j, 1)
    Cells(k, 2) = Cells(j, 2)
    Cells(k, 3) = Cells(j, 3)
  Next k
  j = k
  Worksheets("URL").Select
  i = i + 1
Loop
End Sub

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to