Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding data to existing data that has a unique number in column
Userform1 adds data to the database as such,
A B C D E F G 1 PICKID NAME START FINISH PICKS DATE 2 5 TIM 1900 5-19-06 3 7 BILL 2000 5-19-06 4 8 JOE 1900 5-19-06 ETC. I would like userform2 to add the finish time and picks to the database that corresponds with the appropriate pickid . the forms are already made and i've used a combobox in form2 for the pickid , txtbox for finish , txtbox for picks . I use to forms because users click a start button wich opens form1 and the data is entered as seen above, when finished with task they click finish button wich will open form2 and add the finish time and picks to the database. I would think this is possible , however finding myself confused on this. thanks for any help offered. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding data to existing data that has a unique number in column
Use MATCH (pickID on Userform2 against the database) to get row number and
then assign Userform2 data to appropriate cells. in VBA row=APPLICATION.MATCH(pickid,Data!A:A,0) pickid= Userform2 textbox for pickID Data is you database sheet HTH "Lars" wrote: Userform1 adds data to the database as such, A B C D E F G 1 PICKID NAME START FINISH PICKS DATE 2 5 TIM 1900 5-19-06 3 7 BILL 2000 5-19-06 4 8 JOE 1900 5-19-06 ETC. I would like userform2 to add the finish time and picks to the database that corresponds with the appropriate pickid . the forms are already made and i've used a combobox in form2 for the pickid , txtbox for finish , txtbox for picks . I use to forms because users click a start button wich opens form1 and the data is entered as seen above, when finished with task they click finish button wich will open form2 and add the finish time and picks to the database. I would think this is possible , however finding myself confused on this. thanks for any help offered. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding data to existing data that has a unique number in colum
Thank you for your help , being a beginner i appreciate the way you described
this, however i would greatly appreciate it if you could show me how to incorperate it into this code Private Sub CommandButton1_Click() Dim Row As Long Dim Part As Long Dim ws As Worksheet Set ws = Worksheets("PickData") 'find first empty row in database Row = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row Part = Me.cboBox1.ListIndex 'check for a part number If Trim(Me.cboBox1.Value) = "" Then Me.cboBox1.SetFocus MsgBox "Please enter a pick number" Exit Sub End If 'copy the data to the database With ws .Cells(Row, 4).Value = Me.TextBox3.Value .Cells(Row, 5).Value = Me.TextBox4.Value End With 'clear the data Me.cboBox1.Value = "" Me.TextBox3.Value = "" Me.TextBox4.Value = "" Me.cboBox1.SetFocus End Sub Private Sub UserForm_Initialize() Dim cPart As Range Dim ws As Worksheet Set ws = Worksheets("PickerLists") For Each cPart In ws.Range("IdentifyList") With Me.cboBox1 .AddItem cPart.Value .List(.ListCount - 1, 1) = cPart.Offset(0, 1).Value End With Next cPart Me.TextBox3.Value = "" Me.TextBox4.Value = "" Me.cboBox1.SetFocus End Sub "Toppers" wrote: Use MATCH (pickID on Userform2 against the database) to get row number and then assign Userform2 data to appropriate cells. in VBA row=APPLICATION.MATCH(pickid,Data!A:A,0) pickid= Userform2 textbox for pickID Data is you database sheet HTH "Lars" wrote: Userform1 adds data to the database as such, A B C D E F G 1 PICKID NAME START FINISH PICKS DATE 2 5 TIM 1900 5-19-06 3 7 BILL 2000 5-19-06 4 8 JOE 1900 5-19-06 ETC. I would like userform2 to add the finish time and picks to the database that corresponds with the appropriate pickid . the forms are already made and i've used a combobox in form2 for the pickid , txtbox for finish , txtbox for picks . I use to forms because users click a start button wich opens form1 and the data is entered as seen above, when finished with task they click finish button wich will open form2 and add the finish time and picks to the database. I would think this is possible , however finding myself confused on this. thanks for any help offered. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding data to existing data that has a unique number in colum
Be easier if you sent me a w/book with Userforms etc.
toppers <at NOSPAMjohntopley.fsnet.co.uk remove NOSPAM from e-mail address. "Lars" wrote: Thank you for your help , being a beginner i appreciate the way you described this, however i would greatly appreciate it if you could show me how to incorperate it into this code Private Sub CommandButton1_Click() Dim Row As Long Dim Part As Long Dim ws As Worksheet Set ws = Worksheets("PickData") 'find first empty row in database Row = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row Part = Me.cboBox1.ListIndex 'check for a part number If Trim(Me.cboBox1.Value) = "" Then Me.cboBox1.SetFocus MsgBox "Please enter a pick number" Exit Sub End If 'copy the data to the database With ws .Cells(Row, 4).Value = Me.TextBox3.Value .Cells(Row, 5).Value = Me.TextBox4.Value End With 'clear the data Me.cboBox1.Value = "" Me.TextBox3.Value = "" Me.TextBox4.Value = "" Me.cboBox1.SetFocus End Sub Private Sub UserForm_Initialize() Dim cPart As Range Dim ws As Worksheet Set ws = Worksheets("PickerLists") For Each cPart In ws.Range("IdentifyList") With Me.cboBox1 .AddItem cPart.Value .List(.ListCount - 1, 1) = cPart.Offset(0, 1).Value End With Next cPart Me.TextBox3.Value = "" Me.TextBox4.Value = "" Me.cboBox1.SetFocus End Sub "Toppers" wrote: Use MATCH (pickID on Userform2 against the database) to get row number and then assign Userform2 data to appropriate cells. in VBA row=APPLICATION.MATCH(pickid,Data!A:A,0) pickid= Userform2 textbox for pickID Data is you database sheet HTH "Lars" wrote: Userform1 adds data to the database as such, A B C D E F G 1 PICKID NAME START FINISH PICKS DATE 2 5 TIM 1900 5-19-06 3 7 BILL 2000 5-19-06 4 8 JOE 1900 5-19-06 ETC. I would like userform2 to add the finish time and picks to the database that corresponds with the appropriate pickid . the forms are already made and i've used a combobox in form2 for the pickid , txtbox for finish , txtbox for picks . I use to forms because users click a start button wich opens form1 and the data is entered as seen above, when finished with task they click finish button wich will open form2 and add the finish time and picks to the database. I would think this is possible , however finding myself confused on this. thanks for any help offered. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
adding data to existing data cell | Excel Worksheet Functions | |||
Adding new data to existing data | Excel Worksheet Functions | |||
Copying Data into Column with Existing Data | Excel Discussion (Misc queries) | |||
Adding more source data to existing scatter plot | Charts and Charting in Excel | |||
find rows for unique data in 1 column and different data in other. | Excel Discussion (Misc queries) |