ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,832
- Office Version
- 2007
- Platform
- Windows
On my worksheet i have a table of values.
Row 3 are headers then values are down the page from there.
Table range values are column N to S
I am using the code below.
What i am looking to do is if the value in the table column S = X then delete the row values for column N to S where X is currently shown.
X may be on one row or many rows.
See example screenshot supplied, Column S value is X so the code needs to delete that rows values.
With the code supplied i get a RTE 1004 "OPERATION NOT ALLOWED, THE OPERATION IS ATTEMPTING TO SHIFT CELLS IN A TABLE"
Row 3 are headers then values are down the page from there.
Table range values are column N to S
I am using the code below.
What i am looking to do is if the value in the table column S = X then delete the row values for column N to S where X is currently shown.
X may be on one row or many rows.
See example screenshot supplied, Column S value is X so the code needs to delete that rows values.
With the code supplied i get a RTE 1004 "OPERATION NOT ALLOWED, THE OPERATION IS ATTEMPTING TO SHIFT CELLS IN A TABLE"
Rich (BB code):
Private Sub DeleteCustomer_Click()
Dim tblName As String
Dim tbl As ListObject
Dim R As Long
Dim lr As Long
Dim i As Long
If ActiveCell.Column = 19 And ActiveCell.Row > 3 And ActiveCell.Value = "X" Then
ActiveCell.Resize(1, 6).Delete
End If
End Sub