08-18-2008, 02:36 PM
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
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