ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,699
- Office Version
- 2007
- Platform
- Windows
Hi,
My goal is to select a customer in column A & delete entire row but stuck on the code to answer the question of Do You Wish To Delete Customers Row
I first run the code to make sure a Customer in column A is selected.
If i select a cell in column B i see the Msgbox advising to select column A so that works fine.
If i select a cell in column A this also works fine & the codes then continues & i see the msgbox asking do i wish to delete customers row.
This is where things now go wrong for me.
The black text worked fine on its own BUT when i add the Red text code the msgboxes are out of sync etc
My goal is to select a customer in column A & delete entire row but stuck on the code to answer the question of Do You Wish To Delete Customers Row
I first run the code to make sure a Customer in column A is selected.
If i select a cell in column B i see the Msgbox advising to select column A so that works fine.
If i select a cell in column A this also works fine & the codes then continues & i see the msgbox asking do i wish to delete customers row.
This is where things now go wrong for me.
The black text worked fine on its own BUT when i add the Red text code the msgboxes are out of sync etc
Rich (BB code):
Private Sub CommandButton3_Click()
Dim answer As Integer
If ActiveCell.Column = 1 Then
answer = MsgBox("DELETE CUSTOMERS ROW ?", vbYesNo + vbCritical)
If answer = vbYes Then
EntireRow.Delete
Else
MsgBox "YOU NEED TO SELECT A CUSTOMER IN COLUMN A", vbCritical, "REPEAT CUSTOMER MESSAGE"
End If
End If
End Sub