ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,737
- Office Version
- 2007
- Platform
- Windows
Morning,
I use the code below to allow the user to select a customer in column A which they wish to delete.
It works fine but has an issue once the row has been deleted.
This is the user is unable to use the navigation arrows to move from the selected cell.
The user has to select a cell then a mouse click before they can use the navigation arrow.
Example.
User selects a customer at A111
The code is run & that row is now deleted.
The user now sees the msgbox which confirms that customers row was deleted.
At this point the selected cell is A111 BUT using the navigation arrows does nothing.
So can you advise please once the user at A111 is deleted After the user cilcks OK to the confirmation message box the next cell is then selected Thus A112 in this case.
For future row deletions example A99 once deleted user clicks OK to confiremation message & the cell A100 is selected
I use the code below to allow the user to select a customer in column A which they wish to delete.
It works fine but has an issue once the row has been deleted.
This is the user is unable to use the navigation arrows to move from the selected cell.
The user has to select a cell then a mouse click before they can use the navigation arrow.
Example.
User selects a customer at A111
The code is run & that row is now deleted.
The user now sees the msgbox which confirms that customers row was deleted.
At this point the selected cell is A111 BUT using the navigation arrows does nothing.
So can you advise please once the user at A111 is deleted After the user cilcks OK to the confirmation message box the next cell is then selected Thus A112 in this case.
For future row deletions example A99 once deleted user clicks OK to confiremation message & the cell A100 is selected
Rich (BB code):
Private Sub CommandButton3_Click()
Dim answer As Integer
If ActiveCell.Column = 1 Then
answer = MsgBox("DELETE CUSTOMERS ROW " & ActiveCell.Value, vbYesNo + vbCritical)
If answer = vbYes Then
ActiveCell.EntireRow.Delete
MsgBox "CUSTOMERS ROW NOW DELETED", vbInformation
End If
Else
MsgBox "YOU NEED TO SELECT A CUSTOMER IN COLUMN A", vbCritical, "SELECT CUSTOMER MESSAGE"
End If
End Sub