ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,227
- Office Version
- 2007
- Platform
- Windows
This is the code in use.
My question is,
Currently when the row is deleted it deletes the contents of cells N - R
Ive put an "X" in column M next to some customers names to remind me at the end of the month that this customer must be deleted.
So im trying to see how when the code deletes the row its now needs to also include deleting the X thus being M - R
My question is,
Currently when the row is deleted it deletes the contents of cells N - R
Ive put an "X" in column M next to some customers names to remind me at the end of the month that this customer must be deleted.
So im trying to see how when the code deletes the row its now needs to also include deleting the X thus being M - R
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 = 14 And ActiveCell.Row > 3 And ActiveCell.Value <> "" Then
If MsgBox("ARE YOU SURE YOU WISH TO DELETE THIS CUSTOMER", vbYesNo + vbCritical, "DELETE GRASS CUTTING CUSTOMER") = vbYes Then
ActiveCell.Resize(1, 5).Delete
Else
MsgBox "NO CUSTOMER WAS SELECTED", vbExclamation, "DELETE GRASS CUTTING CUSTOMER"
End If
End If
' Enter table name below
tblName = "Table1"
' Set table object
Set tbl = ActiveSheet.ListObjects(tblName)
' Count rows in table
r = tbl.Range.Rows.Count
' Insert rows if rows if less than 30
If r < 30 Then
' Add needed rows to table
For i = 1 To (32 - r)
tbl.ListRows.Add
Next i
End If
End Sub