ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,226
- Office Version
- 2007
- Platform
- Windows
Morning,
I have this code below which when i select a customer on my sheet then run it that row the customer was on is the deleted.
I find that my range P1:P50 is reduced by a row each time i run it as you would expect.
Sometimes the row to be deleted will be in between other customers.
How can i add a new row or keep my range P1:P50 all the time
I have this code below which when i select a customer on my sheet then run it that row the customer was on is the deleted.
I find that my range P1:P50 is reduced by a row each time i run it as you would expect.
Sometimes the row to be deleted will be in between other customers.
How can i add a new row or keep my range P1:P50 all the time
Rich (BB code):
Private Sub DeleteCustomer_Click()
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
End Sub