I have some problems trying to write the code for this Problem. Especially adding and deleting lineitems (names and phone numbers) in the list and updating the phone numbers.
Any help is very much appreciated.
Thank you very much.
Best regards
Problem Statement
Create a user form that allows the user to manage (add, edit, and delete) the names and phone numbers of contacts.
5 separate subroutines are required:
RunForm the on-sheet button is linked to this sub, which simply opens up the NameForm user form.
PopulateComboBox Prior to opening NameForm, this sub should populate ComboBox1 on NameForm with the names in column A of the spreadsheet.
AddName This sub should enable the user to add another record (row). The name of the new contact is entered into the NewName text box and when the AddButton is clicked, an input box should ask the user for the phone number of the new contact. The new name and phone number should be placed in the next empty row of the spreadsheet with the other data.
DeleteItem After selecting a name from the combo box, the user can delete that contact by clicking on the DeleteButton, which will run the DeleteItem sub. Make sure to remove the deleted item from ComboBox1; otherwise, the deleted item will remain on the drop-down list until the user form is closed.
UpdateNumber The user can select a name from ComboBox1 and modify/update the phone number of that contact by clicking on the PhoneButton. This should run the UpdateNumber sub, which will ask the user for the new number and replace that contacts old number on the spreadsheet with the new number.
1616680244942.png
1616680164514.png
Please Login or Register to view this content.
Bookmarks