View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default paste data from web to next available row

With a macro
You would need to determine how many blank rows are available on existing
sheet.
You would need to know how many rows you are to copy
If not enough, you would need to create another sheet and use that for your
paste using index.

I also recommend that you establish your query and then refresh with
variables or, at least, delete the build up of external names created.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"J.W. Aldridge" wrote in message
...
Found this one here that works for me...
(website on secure server so replaced it here with "x")

Just need to ammend to:
Paste to next available row or next sheet if there is no more space
available.


Sub test()
Dim ipstring As String
Application.DisplayAlerts = False
ipstring = "x"

With ActiveSheet.QueryTables.Add(Connection:="URL;" _
& ipstring, Destination:=Range("a1"))
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.Refresh BackgroundQuery:=False
.SaveData = True
End With

Range(Range("a1"), Range("a1").End(xlDown)).Select

Selection.TextToColumns Destination:=Range("A1"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False,
FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1),
Array(5, 1), Array(6, 1), _
Array(7, 1)), TrailingMinusNumbers:=True
Columns("A:A").Select
Selection.Columns.AutoFit
Range("a1").Select

Application.DisplayAlerts = True
End Sub