Hello, I have a question related to looping through rows and columns and grabbing the last cell location containing data.
This is hard to explain so please bear with me.
I have started with something like below to search in column 1.
For Counter = 6 To 500
Set curCell = Worksheets("Project List").Cells(Counter, 1)
If curCell.Value = "" Then
varcell = Counter
Counter = 500
End If
Next Counter
The above grabs the first cell in column 1 that does not contain data. However, if a row is left blank, and the next row contains data it stops short.
For example, from the following, the value I would be looking for would be C5.
|A|B|C|
1|x|x|x|
2|x| | |
3| | | |
4| | | |
5| | |x|
Your help is greatly appreciated.
Thanks!
This is hard to explain so please bear with me.
I have started with something like below to search in column 1.
For Counter = 6 To 500
Set curCell = Worksheets("Project List").Cells(Counter, 1)
If curCell.Value = "" Then
varcell = Counter
Counter = 500
End If
Next Counter
The above grabs the first cell in column 1 that does not contain data. However, if a row is left blank, and the next row contains data it stops short.
For example, from the following, the value I would be looking for would be C5.
|A|B|C|
1|x|x|x|
2|x| | |
3| | | |
4| | | |
5| | |x|
Your help is greatly appreciated.
Thanks!