my code says to find the last empty cell (in a column) but i would like it to select that cell if its empty, but still has a border around it (or possibly it wont... point is, it shouldnt matter if it has a border or not, just that if it doesn;t contain a string, then it should select that cell & column)
I tried
but that gave me an error.
So how can i make it select the last empty (column) cell in row 1 that has a border around it, but doesn't contain any text?
Also, the cells in row 1 will always be strings, no numbers.
btw, this is what I see when i run the code and it selects the column:
Code:
Private Sub cmdLastRow_Click()
Dim lCol As Long
lCol = ActiveSheet.UsedRange.Columns.Count
Dim rCell As Range
For Each rCell In Range(Cells(1, 8), Cells(1, lCol + 1))
[COLOR=#0000ff][B]If rCell = "" Then
[/B][/COLOR]
Columns.EntireColumn(lCol + 1).EntireColumn.Select
Else
End If
Next rCell
End Sub
I tried
Code:
[B][COLOR=#0000ff]If rCell Is Null Then[/COLOR][/B]
but that gave me an error.
So how can i make it select the last empty (column) cell in row 1 that has a border around it, but doesn't contain any text?
Also, the cells in row 1 will always be strings, no numbers.
btw, this is what I see when i run the code and it selects the column: