![]() |
Updating a Data List
Would someone be so kind to provide a VBA code I can assign to a command
button on a user form that will transfer the data just entered in the form's fields to a list located on a separate worksheet within the same workbook? I would like each click of the button to update the list by adding new row and then to clear the user form preparing it for new data entry. I don't want to use MS Access for that function. Thanks a lot! |
Updating a Data List
There's a sample file here that stores data on a hidden worksheet:
http://www.contextures.com/excelfiles.html#UserForm Under 'UserForms', look for 'Parts Database' Plamen A. Vachovski wrote: Would someone be so kind to provide a VBA code I can assign to a command button on a user form that will transfer the data just entered in the form's fields to a list located on a separate worksheet within the same workbook? I would like each click of the button to update the list by adding new row and then to clear the user form preparing it for new data entry. I don't want to use MS Access for that function. -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
Updating a Data List
In my example your command button (CommandButton1)
loads data from ten text boxes and a combo box into the next available row on the designated sheet...its quite easy to follow. The text boxes are named textbox1, textbox2,..., textbox10 Finally the value of a combbox is also added. Private Sub CommandButton1_Click() Dim target As Range Dim i As Long target = Worksheets("Sheet1").Range("A65000").End (xlUp).Offset(1, 0) target.Value = Format$(Date, "dd-mm-yyyy") For i = 1 To 10 target.Offset(0, i).Value = _ Controls("textbox" & i).Text Controls("textbox" & i).Text = "" Next target.Offset(0, 11).Value = ComboBox1.Value End Sub This should get you started Patrick Molloy Microsoft Excel MVP -----Original Message----- Would someone be so kind to provide a VBA code I can assign to a command button on a user form that will transfer the data just entered in the form's fields to a list located on a separate worksheet within the same workbook? I would like each click of the button to update the list by adding new row and then to clear the user form preparing it for new data entry. I don't want to use MS Access for that function. Thanks a lot! . |
All times are GMT +1. The time now is 06:53 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com