fari1
Active Member
- Joined
- May 29, 2011
- Messages
- 362
Hi,
I've a loop code, which runs through a column and connects every URL in that column to the web and brings in data. it works perfect, when there'r two or more than two cells of URLs, but when there's just one cell of URL, then, it starts considering the blank cell as well into the loop and obviously gives error. can somebody amend it to make it work even when there is single cell of data
I've a loop code, which runs through a column and connects every URL in that column to the web and brings in data. it works perfect, when there'r two or more than two cells of URLs, but when there's just one cell of URL, then, it starts considering the blank cell as well into the loop and obviously gives error. can somebody amend it to make it work even when there is single cell of data
Code:
Sub loopB()
Dim cel As Range
Dim mySheet As Worksheet
Set mySheet = Sheets("sheet1")
For Each cel In Sheets("URLs").Range("A2:A" & Sheets("URLs").Range("A2").End(xlDown).Row)
mySheet.Range("A1") = cel.Value
Next cel
End Sub