Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populating worksheet from userform combobox
I'm having problems trying to get the selected item in the combobox t populate the existing row in the worksheet. When I click on th selected item in the combobox and save to the worksheet it adds th item to the next empty row instead of using the existing row, creatin a duplicate item entry. What I would like to happen is if the ite already exists in the combobox, then add rest of the userform data t that existing row on the worksheet. If a new item is entered in th combobox, then the userform data would be entered in the next availabl empty row -- buckcho ----------------------------------------------------------------------- buckchow's Profile: http://www.officehelp.in/member.php?userid=597 View this thread: http://www.officehelp.in/showthread.php?t=131886 Posted from - http://www.officehelp.i |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populating worksheet from userform combobox
Hi Buckchow,
Please can you post your code so that somebody could provide could help me. -- Hope this helps Martin Fishlock, Bangkok, Thailand Please do not forget to rate this reply. "buckchow" wrote: I'm having problems trying to get the selected item in the combobox to populate the existing row in the worksheet. When I click on the selected item in the combobox and save to the worksheet it adds the item to the next empty row instead of using the existing row, creating a duplicate item entry. What I would like to happen is if the item already exists in the combobox, then add rest of the userform data to that existing row on the worksheet. If a new item is entered in the combobox, then the userform data would be entered in the next available empty row. -- buckchow ------------------------------------------------------------------------ buckchow's Profile: http://www.officehelp.in/member.php?userid=5975 View this thread: http://www.officehelp.in/showthread.php?t=1318864 Posted from - http://www.officehelp.in |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populating worksheet from userform combobox
Listed below is the code I'm having a problem with: Private Sub UserForm_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Data") txtBatch1.SetFocus 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row 'check for a part number If Trim(Me.txtBatch1.Value) = "" Then Me.txtBatch1.SetFocus MsgBox "Please enter a batch number" Exit Sub End If 'copy the data to the database ws.Cells(iRow, 1).Value = Me.txtBatch1.Value ws.Cells(iRow, 2).Value = Me.txtDate1.Value ws.Cells(iRow, 3).Value = Me.txtCust1.Value ws.Cells(iRow, 4).Value = Me.txtBoard1.Value ws.Cells(iRow, 5).Value = Me.txtSerial1.Value ws.Cells(iRow, 6).Value = Me.txtQty1.Value ws.Cells(iRow, 18).Value = Me.txtStatus1.Value ws.Cells(iRow, 17).Value = Me.txtNotes.Value 'clear the data Me.txtBatch1.Value = "" Me.txtDate1.Value = "" Me.txtCust1.Value = "" Me.txtBoard1.Value = "" Me.txtSerial1.Value = "" Me.txtQty1.Value = "" Me.txtStatus1.Value = "" Me.txtNotes.Value = "" Me.txtBatch1.SetFocus End Su -- buckcho ----------------------------------------------------------------------- buckchow's Profile: http://www.officehelp.in/member.php?userid=597 View this thread: http://www.officehelp.in/showthread.php?t=131886 Posted from - http://www.officehelp.i |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Populating a ComboBox in a UserForm | Excel Programming | |||
Populating Userform ComboBox with worksheet names in XL2003 | Excel Programming | |||
Populating a ComboBox | Excel Programming | |||
populating a combobox on a worksheet | Excel Programming |