Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to delete empty rows
#1
I want to create a macro that delete all empty rows and bring rows up.

Sub delete()

Rows("2:2, 5:5").Select
Selection.delete Shift:=xlUp

End Sub

I recorded a macro but it is only selecting specified rows e.g 2 and 5 and ofcourse if i run this macro again then it deletes value from 2 and 5 again. What i need is if my excel sheet finds any empty rows, macro deletes them and bring rows up if there is no empty rows in whole sheet then it should not do anything. Any suggestion ??

-Thank you,
Raaz


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)