Delete Row based off cell content
My spreadsheet has over 1000 lines of data. I'm exporting daily so the
information changes and I do not append to the previous day's data. Because of the way this report exports out of the host system (which I can't change), at random rows, a cell in a random column is populated with the words "System generated". I'm running a series of macros to clean up this spreadsheet before I import to Access. I need a code that will delete the entire row when this specfic word appears anywhere in the spreadsheet. I've tried recording a macro using the filter, but this doesn't seem to work since the data changes daily. Please help! Chuck |
Delete Row based off cell content
Hi Chuck
See http://www.rondebruin.nl/delete.htm data changes daily You can try EasyFilter to do it http://www.rondebruin.nl/easyfilter.htm -- Regards Ron de Bruin http://www.rondebruin.nl "Chuck Neal" wrote in message ... My spreadsheet has over 1000 lines of data. I'm exporting daily so the information changes and I do not append to the previous day's data. Because of the way this report exports out of the host system (which I can't change), at random rows, a cell in a random column is populated with the words "System generated". I'm running a series of macros to clean up this spreadsheet before I import to Access. I need a code that will delete the entire row when this specfic word appears anywhere in the spreadsheet. I've tried recording a macro using the filter, but this doesn't seem to work since the data changes daily. Please help! Chuck |
Delete Row based off cell content
This sample only looks at the first 100 rows, you can adapt it for your needs:
Sub macdel() Dim L As Long For L = 100 To 1 Step -1 If Application.CountIf(Rows(L), "System generated") = 1 Then Rows(L).EntireRow.Delete End If Next End Sub The sample code also assumes that System generated is by itself in a cell. -- Gary's Student "Chuck Neal" wrote: My spreadsheet has over 1000 lines of data. I'm exporting daily so the information changes and I do not append to the previous day's data. Because of the way this report exports out of the host system (which I can't change), at random rows, a cell in a random column is populated with the words "System generated". I'm running a series of macros to clean up this spreadsheet before I import to Access. I need a code that will delete the entire row when this specfic word appears anywhere in the spreadsheet. I've tried recording a macro using the filter, but this doesn't seem to work since the data changes daily. Please help! Chuck |
Delete Row based off cell content
Ron,
Your Union example did the trick. Thank you VERY much! Chuck "Ron de Bruin" wrote: Hi Chuck See http://www.rondebruin.nl/delete.htm data changes daily You can try EasyFilter to do it http://www.rondebruin.nl/easyfilter.htm -- Regards Ron de Bruin http://www.rondebruin.nl "Chuck Neal" wrote in message ... My spreadsheet has over 1000 lines of data. I'm exporting daily so the information changes and I do not append to the previous day's data. Because of the way this report exports out of the host system (which I can't change), at random rows, a cell in a random column is populated with the words "System generated". I'm running a series of macros to clean up this spreadsheet before I import to Access. I need a code that will delete the entire row when this specfic word appears anywhere in the spreadsheet. I've tried recording a macro using the filter, but this doesn't seem to work since the data changes daily. Please help! Chuck |
All times are GMT +1. The time now is 07:59 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com