Store the results of a QueryTable in an array rather than a range of cells

Mr. Snrub

Board Regular
Joined
May 22, 2005
Messages
147
Office Version
  1. 365
Platform
  1. Windows
I have the following code which places results from a web query into a QueryTable, starting at cell B2:

Code:
    With ActiveSheet.QueryTables.Add(Connection:= _
      "URL;" & url, _
         Destination:=Range("$B$2"))
      .WebFormatting = xlNone
      .WebSelectionType = xlSpecifiedTables
      .WebTables = "2"
      .FieldNames = True
      .RowNumbers = False
      .FillAdjacentFormulas = False
      .PreserveFormatting = True
      .RefreshOnFileOpen = False
      .BackgroundQuery = True
      .RefreshStyle = xlInsertDeleteCells
      .SavePassword = False
      .SaveData = True
      .AdjustColumnWidth = True
      .RefreshPeriod = 0
      .BackgroundQuery = True
      .Refresh BackgroundQuery:=False
      .SaveData = True
      
   End With

The problem is that this is supposed to be a multi-row and multi-column table, but each row of this result is one long string with commas taking up one cell. I want to modify these results and split the string by a comma delimiter and then paste those results into a range of cells starting at B2. Basically I want the Destination to be a two-dimensional array instead of a range of cells. How do I do this?
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,216,122
Messages
6,128,961
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top