PaulFletcher
New Member
- Joined
- Oct 7, 2016
- Messages
- 13
Hi,
I have written the below code to search a value and if found remove the entire row and if successful pop a message advising the record has been deleted.
I have two problems:
1. When there is no data the message will still pop up confirming something has been deleted which isn't the case. When there is data the message pop's up twice?
2. I have attempted to add further code using "Else" to pop a further message advising if a record does not exist but also cannot get this to work.
With .Cells(Lrow, "A")
If Not IsError(.Value) Then
If .Value = ThisWorkbook.Sheets("Input").Range("B21") Then .EntireRow.Delete
MsgBox "Record Deleted"
End If
End With
Any help would be much appreciated.
Thanks
Paul
I have written the below code to search a value and if found remove the entire row and if successful pop a message advising the record has been deleted.
I have two problems:
1. When there is no data the message will still pop up confirming something has been deleted which isn't the case. When there is data the message pop's up twice?
2. I have attempted to add further code using "Else" to pop a further message advising if a record does not exist but also cannot get this to work.
With .Cells(Lrow, "A")
If Not IsError(.Value) Then
If .Value = ThisWorkbook.Sheets("Input").Range("B21") Then .EntireRow.Delete
MsgBox "Record Deleted"
End If
End With
Any help would be much appreciated.
Thanks
Paul