Answer the question
In order to leave comments, you need to log in
How to find last empty cell MS Excel VBA inline method?
I want to hide cells where the formula outputs an empty string.
I tried this (and a couple of other Excel methods)
Dim Row
Row = Sheet1.Range(Cells(8, 2), Cells(500, 2)).Find("*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row
Sheet1.Range(Cells(Row, 2), Cells(500, 2)).EntireRow.Hidden = True
Dim Row
For i=500 To 8 Step -1
If Sheet1.Cells(i,2)<>"" Then
Row = i
Exit For
End If
Next i
Sheet1.Range(Cells(Row, 2), Cells(500, 2)).EntireRow.Hidden = True
Answer the question
In order to leave comments, you need to log in
When I wrote macros in VBA more or less professionally, I used macro recording,
pressed a key combination, as I think I pressed Alt + End, I got this code:
I hope it helps.
PS
You can google xlLastCell VBA Excel and probably find a bunch of more suitable examples.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question