billyheanue
Board Regular
- Joined
- Jul 13, 2015
- Messages
- 109
Hi Everyone,
So I have code that successfully vlookups ONE specific cell, in a column of "Lookup Values".
Im wondering how I would go about having the code also continue on the column, and lookup the next cell "B17", and then "B18", and so forth, until the values in the column become blank. I also want to emphasize that the code needs to keep the current region bit!
Is this a "For Each...Next" loop?
Thanks Everyone!!
So I have code that successfully vlookups ONE specific cell, in a column of "Lookup Values".
Code:
Private Sub CommandButton4_Click()
LookupVal = Sheets("Sheet1").Range("B16").Value
Range("A5").Formula = "=VLOOKUP(" & LookupVal & ",Sheet2!" & Sheets("Sheet2").Range("A4").CurrentRegion.Address & _
",Sheet1!G13,FALSE)"
End Sub
Im wondering how I would go about having the code also continue on the column, and lookup the next cell "B17", and then "B18", and so forth, until the values in the column become blank. I also want to emphasize that the code needs to keep the current region bit!
Is this a "For Each...Next" loop?
Thanks Everyone!!