Hello,
I am trying to code the following:
I have supplier names in Column A, and I am searching by the name of the supplier by using the match command, which provides the Row value of the searched name.
Then I would like to delete the supplier that has been found in the array.
So I am using the following code to delete the entire row and shift it up.
The 1 in ws.Cells is the Column where the data is found, which is the whole Column A.
I can find the correct name in the array but once I click delete, this error is showing
Run-time error '1004':
Select method of Range class failed
Thank you, anyone please shed some light, will appreciate your efforts.
I am trying to code the following:
I have supplier names in Column A, and I am searching by the name of the supplier by using the match command, which provides the Row value of the searched name.
Then I would like to delete the supplier that has been found in the array.
So I am using the following code to delete the entire row and shift it up.
Code:
SearchVal = Me.txtSearch.Value
RowVal = Application.Match(CDbl(SearchVal), ws.Range("B:B"), 0)
ws.Cells(RowVal, 1).EntireRow.Select
Selection.Delete Shift:=xlUp
MsgBox "Item deleted from database"
I can find the correct name in the array but once I click delete, this error is showing
Run-time error '1004':
Select method of Range class failed
Thank you, anyone please shed some light, will appreciate your efforts.
Last edited: