Macro to Find and Replace
Closed
SarahC
-
Mar 13, 2012 at 06:39 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Mar 19, 2012 at 11:26 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Mar 19, 2012 at 11:26 AM
Related:
- Macro to Find and Replace
- Spell number in excel without macro - Guide
- How to replace a word in word - Guide
- Excel macro to create new sheet based on value in cells - Guide
- Macro excel download - Download - Spreadsheets
- Run macro on opening workbook - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Mar 19, 2012 at 11:26 AM
Mar 19, 2012 at 11:26 AM
Hi Sarah,
Please make a backup of your file first, since deleted data can't be retreived.
The following code will search column A for the value entered in D32. When a match is found, it's row will be deleted.
Best regards,
Trowa
Please make a backup of your file first, since deleted data can't be retreived.
The following code will search column A for the value entered in D32. When a match is found, it's row will be deleted.
Sub DeleteRow() Dim lRow As Integer Dim sValue As String lRow = Range("A" & Rows.Count).End(xlUp).Row sValue = Range("D32").Value For Each cell In Range("A1:A" & lRow) If cell.Value = sValue Then cell.EntireRow.Delete Next cell End Sub
Best regards,
Trowa