Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi all, Trying to loop through entire woorksheet and then based on cell criteria (empty or not) delete the entire row. I have the following implemented....but dows not work; Code: -------------------- Private Sub cmdFilter_Click() 'Copy Data Sheet & Paste Data onto a New Sheet Cells.Select Selection.Copy Worksheets.Add ActiveSheet.Paste ActiveSheet.Rows(1).Select Selection.Delete 'Delete rows that are not needed strMySheet = ActiveSheet.Name Sheets(strMySheet).Select Sheets(strMySheet).Cells(1, 1).Select i = 1 Do If (Cells(i, 4).Value = "") And (Cells(i, 5).Value < "") Then Sheets(strMySheet).Cells(i, 1).Select Selection.EntireRow.Delete End If i = i + 1 Loop Until (Sheets(strMySheet).Cells(i, 1).Value < "") End Sub -------------------- Any tips or feedback welcome! Thanks -- gti_jobert ------------------------------------------------------------------------ gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634 View this thread: http://www.excelforum.com/showthread...hreadid=517729 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro for deleting rows and serialising the remaing rows | Setting up and Configuration of Excel | |||
Macro for deleting rows and serialising the remaing rows | Excel Worksheet Functions | |||
Help!! I have problem deleting 2500 rows of filtered rows!!!! | Excel Discussion (Misc queries) | |||
Help!!! I have problem deleting 2500 rows of filtered rows | Excel Programming | |||
deleting hidden rows so i can print only the rows showing?????? | Excel Worksheet Functions |