Please, dear MrExcel, how to find last empty cell or last NOT empty cell from three columns, then delete rows? Using VBA.
[TABLE="class: cms_table"]
john
[/td][td]MArk
[/td][td]Julia
[/td][/tr][tr][td]Johnson
[/td][td]john
[/td][td]Mark
[/td][/tr][tr][td][/td][td][/td][td]John
[/td][/tr][tr][td][/td][td][/td][td][/td][/tr][tr][td][/td][td][/td][td][/td][/tr][tr][td][/td][td][/td][td][/td][/tr][tr][td][/td][td][/td][td][/td][/tr][tr][td][/td][td][/td][td][/td][/tr][tr][td][/td][td][/td][td][/td][/tr][tr][td][/td][td][/td][td][/td][/tr][tr][td][/td][td][/td][td][/td][/tr][tr][td][/td][td][/td][td][/td][/tr][tr][td][/td][td][/td][td][/td][/tr][tr][td][/td][td][/td][td][/td][/tr][tr][td][/td][td][/td][td][/td][/tr]
[/TABLE]
How to delete empty rows from third column to down, actually I have B2:B15, K2:K15, T2:T15, I need to delete rows from 5:15. But sometimes there will be more data in B or K column, I need to find last non empty cell in these ranges and then delete rows:15
Thank you in advance!
Code:
Code
Dim g As Long, r As Long, u As Long
For g = Cells(Rows.Count, "B").End(xlUp).Row To 1 Step -1
For r = Cells(Rows.Count, "K").End(xlUp).Row To 1 Step -1
For u = Cells(Rows.Count, "T").End(xlUp).Row To 1 Step -1
If Cells(g, "B") = "" Then Cells(g, "B").EntireRow.Delete xlUp
ElseIf Cells(r, "K") = "" Then Cells(r, "K").EntireRow.Delete xlUp
ElseIf Cells(u, "T") = "" Then Cells(u, "T").EntireRow.Delete xlUp
Next u
Next r
Next g
This code not working, it watches only B, and then deletes all data from rows
Sorry bad english