Lee Rabbit
New Member
- Joined
- Apr 30, 2020
- Messages
- 43
- Office Version
- 2010
- Platform
- Windows
Good Day All,
I have created a delete button to remove data from a table.
I also want to delete the worksheet named by the cell value contained in column "B" of the data row.
I am having difficulty in linking the cell value of the row to the worksheet to delete. Still learning
A big thank you in advance to anyone who can help.
Regards,
Lee
I have created a delete button to remove data from a table.
I also want to delete the worksheet named by the cell value contained in column "B" of the data row.
I am having difficulty in linking the cell value of the row to the worksheet to delete. Still learning
VBA Code:
Private Sub CommandButton2_Click()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("DATA ENTRY")
Dim it As Integer
If ActiveCell.Row > 6 Then
it = MsgBox("ARE YOU SURE YOU WANT TO DELETE THIS DRIVER?", vbQuestion + vbYesNo)
If it = 7 Then Exit Sub
ActiveCell.EntireRow.Delete
End If
End Sub
A big thank you in advance to anyone who can help.
Regards,
Lee