Hello,
New to VBA. I created this workbook over the last 24 hours by watching youtube videos and have no prior vba or coding experience.
The purpose of this workbook is for client management. I've created macros to add/update/delete clients from the "summary" sheet using a form. Once a client is on the summary list, I can automatically create a unique detail sheet for them using the "Create Client Detail Sheet" macro button and the sheet is automatically named using the client's name "Lastname, Firstname & Firstname".
What I want to be able to do is, when I am in the add/update/delete userform and I select a client and hit delete, I want their corresponding client detail sheet to delete as well. Is this possible?
Below are the current lines of code that correspond to the delete button being clicked. I don't even know how to attempt updating for what I want. Not sure if this is all you will need or not. Again I'm very new to this. Any guidance is appreciated.
New to VBA. I created this workbook over the last 24 hours by watching youtube videos and have no prior vba or coding experience.
The purpose of this workbook is for client management. I've created macros to add/update/delete clients from the "summary" sheet using a form. Once a client is on the summary list, I can automatically create a unique detail sheet for them using the "Create Client Detail Sheet" macro button and the sheet is automatically named using the client's name "Lastname, Firstname & Firstname".
What I want to be able to do is, when I am in the add/update/delete userform and I select a client and hit delete, I want their corresponding client detail sheet to delete as well. Is this possible?
Below are the current lines of code that correspond to the delete button being clicked. I don't even know how to attempt updating for what I want. Not sure if this is all you will need or not. Again I'm very new to this. Any guidance is appreciated.
VBA Code:
Private Sub buttonDelete_Click()
If MsgBox("Are you sure you want to delete this client?", vbYesNo, "Delete Client") = vbYes Then
Call DeleteRow(listboxClientInfo.ListIndex)
End If
End Sub
Public Sub DeleteRow(ByVal row As Long)
Sheets("Summary").Range("A6").Offset(row).EntireRow.Delete
End Sub