![]() |
Form Input, with (listbox) review then copy to worksheet
Hi All, Hope you can help me here and that I'm not trying to do th impossible. I have a major module that I'm working on where the user inputs dat into the form this data includes: product state start date end date deal rate total amount I have 2 forms - one where the data is entered and the other where i is reviewed(i was thinking of a listbox for the second) The user puts in one product and the form transfers the data to th different cells in the spreadsheet, and then the form is made blank an the user can enter another product. What I want is a middle / review section where the data is transfere to a listbox so the user can double check the data. If the user woul like to make changes they can click the line and will be returned t the original form and the variables to that product line will be show and can be edited. When the review data as ok, teh user presses a button and then the dat is transfered to the spreadsheet line by line. I hope this makes sense and someone can help me as I am really stuc and I am trying to get this finished asap. THANK YOU AL -- Sami8 ----------------------------------------------------------------------- Sami82's Profile: http://www.excelforum.com/member.php...fo&userid=2711 View this thread: http://www.excelforum.com/showthread.php?threadid=47199 |
Form Input, with (listbox) review then copy to worksheet
Hi Sami82,
Try this code below cut and paste to a userform with 2 listbox and 2 commandbuttons. See if this code helps you attaining what you want. Hope this helps. Private Sub CommandButton1_Click() If Lb1.ListIndex = 0 Then Lb2.AddItem Lb1.Text Lb1.RemoveItem Lb1.ListIndex End If End Sub Private Sub CommandButton2_Click() Do While Lb1.ListCount 0 Lb2.AddItem Lb1.List(0) Lb1.RemoveItem (0) Loop End Sub Private Sub UserForm_Activate() UserForm1.Caption = "Use of Listbox" CommandButton1.Caption = "Transfer to Listbox 2" CommandButton2.Caption = "Transfer All" With Lb1 ..AddItem Cells(1, 1).Value ..AddItem Cells(2, 1).Value ..AddItem Cells(3, 1).Value ..AddItem "Darryl" ..AddItem "Dom" ..AddItem "Donna" ..AddItem "Debra" ..AddItem "Dan" ..AddItem "Dieter" End With End Sub Note: Try to put a value name for Cells(1,1).Value, Cells(2,1).Value etc. "Sami82" wrote: Hi All, Hope you can help me here and that I'm not trying to do the impossible. I have a major module that I'm working on where the user inputs data into the form this data includes: product state start date end date deal rate total amount I have 2 forms - one where the data is entered and the other where it is reviewed(i was thinking of a listbox for the second) The user puts in one product and the form transfers the data to the different cells in the spreadsheet, and then the form is made blank and the user can enter another product. What I want is a middle / review section where the data is transfered to a listbox so the user can double check the data. If the user would like to make changes they can click the line and will be returned to the original form and the variables to that product line will be shown and can be edited. When the review data as ok, teh user presses a button and then the data is transfered to the spreadsheet line by line. I hope this makes sense and someone can help me as I am really stuck and I am trying to get this finished asap. THANK YOU ALL -- Sami82 ------------------------------------------------------------------------ Sami82's Profile: http://www.excelforum.com/member.php...o&userid=27111 View this thread: http://www.excelforum.com/showthread...hreadid=471995 |
All times are GMT +1. The time now is 04:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com