jamescooper
Well-known Member
- Joined
- Sep 8, 2014
- Messages
- 840
I have the following data in columns E and F.
In G via a loop I am trying to populate - I have given a few examples in the right column as to how it should look. This attempt isn't quite working.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Apples[/TD]
[TD]3[/TD]
[TD]Apples &page=1&count=48[/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD]2[/TD]
[TD]Apples &page=2&count=48[/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD]2[/TD]
[TD]Apples &page=3&count=48[/TD]
[/TR]
[TR]
[TD]Grapes[/TD]
[TD]3[/TD]
[TD]Grapes &page=1&count=48[/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bananas[/TD]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Any help appreciated, thanks!
In G via a loop I am trying to populate - I have given a few examples in the right column as to how it should look. This attempt isn't quite working.
Code:
Sub Loop1()
Dim i As Integer
Dim j As Integer
NumberRows = Application.WorksheetFunction.CountA(Columns("E:E"))
For j = 1 To NumberRows
For i = 1 To Cells(1, 6).Value
Cells(j, 7) = (Cells(j, 5) & "&page=" & i & "&count=48")
Next
Next
End Sub
[TABLE="width: 500"]
<tbody>[TR]
[TD]Apples[/TD]
[TD]3[/TD]
[TD]Apples &page=1&count=48[/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD]2[/TD]
[TD]Apples &page=2&count=48[/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD]2[/TD]
[TD]Apples &page=3&count=48[/TD]
[/TR]
[TR]
[TD]Grapes[/TD]
[TD]3[/TD]
[TD]Grapes &page=1&count=48[/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bananas[/TD]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apples[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Pears[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Any help appreciated, thanks!