Hello There,
I have the below sub to which should delete rows based on value match in a table column. It does delete the rows. Could you please assist in correcting the below code or any other VBA Code which could delete rows in a table based on a value matched to a certain column?
Thanks & regards,
Don
I have the below sub to which should delete rows based on value match in a table column. It does delete the rows. Could you please assist in correcting the below code or any other VBA Code which could delete rows in a table based on a value matched to a certain column?
Code:
Sub DeleteBatchProcessSummary(pTable As ListObject, pBatchNumberValue As String)
Dim Fnd As Range, rngSearch As Range, TblSearchColumn As String, TblSearchColumnValue As String
Set Fnd = pTable.ListColumns("Batch Number").DataBodyRange.Find(What:=pBatchNumberValue, LookIn:=xlValues, LookAt:=xlWhole)
If Not Fnd Is Nothing Then
Intersect(pTable.ListColumns("Batch Number").DataBodyRange, Fnd.EntireRow).Delete
End If
End Sub
Thanks & regards,
Don