Macro to Find and Replace
Closed
SarahC
-
13 Mar 2012 à 06:39
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 19 Mar 2012 à 11:26
TrowaD Posts 2921 Registration date Sunday 12 September 2010 Status Contributor Last seen 27 December 2022 - 19 Mar 2012 à 11:26
Related:
- Macro to Find and Replace
- Replace abbreviation - Guide
- How to replace motherboard battery - Guide
- How to run a macro in excel - Guide
- How often replace sponge? - Home - Apps & Sites
- How to run macro in excel - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday 12 September 2010
Status
Contributor
Last seen
27 December 2022
555
19 Mar 2012 à 11:26
19 Mar 2012 à 11:26
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