Even though i can write little bit VB code, I am relative beginner, hence i would like if someone could help me with this.
I have set up a perfect loop, that changes cell values from named table
here is code:
now what i want is, i have set up a Web-Query that will take value for URL from the B4 and will get me the data.
How can I import/use the saved ".iqy file" inside above VBA code to take value from B4 as URL, OR
Have a web-query run to get data with B4 as URL
A sample dataset:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]mainID[/TD]
[TD]Value will be taken from named table[/TD]
[TD]From VBA[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]subIDType[/TD]
[TD]Value will be taken from named table[/TD]
[TD]From VBA[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]coreID[/TD]
[TD]Vlookup Formula to look for corresponding coreID with ref to mainID[/TD]
[TD]Formula[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Concatenate[/TD]
[TD]Concatenate Formula that will combine 1,2,3 to form URL[/TD]
[TD]Formula[/TD]
[/TR]
</tbody>[/TABLE]
I have set up a perfect loop, that changes cell values from named table
here is code:
Code:
Sub LoopThroughForEachCellInARange()
Dim OutputAddress As String
Dim rng As Range: Set rng = Application.Range("subIDType") 'value for B2
Dim cell As Range
Dim rng2 As Range: Set rng2 = Application.Range("mainID") 'value for B1
Dim cel2 As Range
For Each cel2 In rng2.Cells
With cel2
'Debug.Print .Value
Worksheets("sheet1").Select
Worksheets("sheet1").Range("B1") = .Value
For Each cel In rng.Cells
With cel
'Debug.Print .Value
Worksheets("sheet1").Select
Worksheets("sheet1").Range("B2") = .Value
End With
Next cel
End With
Next cel2
End Sub
now what i want is, i have set up a Web-Query that will take value for URL from the B4 and will get me the data.
How can I import/use the saved ".iqy file" inside above VBA code to take value from B4 as URL, OR
Have a web-query run to get data with B4 as URL
A sample dataset:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]mainID[/TD]
[TD]Value will be taken from named table[/TD]
[TD]From VBA[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]subIDType[/TD]
[TD]Value will be taken from named table[/TD]
[TD]From VBA[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]coreID[/TD]
[TD]Vlookup Formula to look for corresponding coreID with ref to mainID[/TD]
[TD]Formula[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Concatenate[/TD]
[TD]Concatenate Formula that will combine 1,2,3 to form URL[/TD]
[TD]Formula[/TD]
[/TR]
</tbody>[/TABLE]