VBA Help, just a quicky [modified]
-
All I want to do is create a VBA script in Excel 2003 where I search through a spreadsheet, and delete every row where column E in the row (a date and time field) does not contain the text 2008. So e.g. If E1 contains 2008 delete row 1 If E2 does not contain 2008 keep this row (row 2) If E3 contains 2008 delete row 3 Continue until no more values How would I do this please? I have tried to do it using in built features on Excel but i can only find and replace...etc and the macro recording isnt really helping much hense why i am asking for your help. Thanks:confused:
modified on Tuesday, May 13, 2008 5:23 AM
-
All I want to do is create a VBA script in Excel 2003 where I search through a spreadsheet, and delete every row where column E in the row (a date and time field) does not contain the text 2008. So e.g. If E1 contains 2008 delete row 1 If E2 does not contain 2008 keep this row (row 2) If E3 contains 2008 delete row 3 Continue until no more values How would I do this please? I have tried to do it using in built features on Excel but i can only find and replace...etc and the macro recording isnt really helping much hense why i am asking for your help. Thanks:confused:
modified on Tuesday, May 13, 2008 5:23 AM
harveyhanson wrote:
All I want to do is create a VBA script in Excel 2003 where I search through a spreadsheet, and delete every row where column E in the row (a date and time field) does not contain the text 2008. So e.g. If E1 contains 2008 delete row 1 If E2 does not contain 2008 keep this row (row 2) If E3 contains 2008 delete row 3 Continue until no more values
The Rows collection of the worksheet has a Delete function which you can use to delete an entire row. For example:
ActiveSheet.Rows(1).Delete
will delete row 1. HTH