I have a form with 5 textboxes below each other and next to each textbox a button that removes the values in that textbox and hides the last textbox (creating the impression that that row is deleted and the other rows jumped one up).
If textbox1 is removed my code reads:
You can see that this code gets very long when there is more than 1 textbox in a row and a number of rows.![]()
Private Sub btnRemove1_Click() textbox1.value=textbox2.value textbox2.value=textbox3.value textbox3.value=textbox4.value textbox4.value=textbox5.value textbox5.value=0 textbox5.visible=false End sub
Surely there must be a shorter way. Could any of the smart men help this fool? (The values of the textboxes are stored on a sheet.)
Bookmarks