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 January 16, 2023 - Mar 19, 2012 at 11:26 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Mar 19, 2012 at 11:26 AM
Related:
- Macro to Find and Replace
- Run macro when cell value changes - Guide
- Macro to copy data from one sheet to another based on criteria ✓ - Excel Forum
- Photoshop replace color greyed out ✓ - Software Forum
- Macro excel download - Download - Spreadsheets
- Find and replace blank cells in excel ✓ - Programming Forum
1 reply
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 16, 2023
544
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