Hey guys,
I have a problem I can't really seem to get working.
As of now I have a userform where you can input in to textboxes, listbox and adds it to another sheet. That works fine.
Right now i want to give the user "add item" listboxes where they can add multiple items in the left listbox (listbox1) to the right listbox(listbox2). That works fine. What is not working is the transfer from listbox2 to columns. The problem is that people can add 1 or 7 items, so it has to take in to account how many items are added to listbox2. Furthermore it needs to start adding it to column 7.
So 1st line in listbox2 should be at column 7, 2nd line in column 8 and so on. Hope you understand.
Right now i'm using emptyRow to insert the inputs in to the columns right now.
You can see my "add" button here:
What can i do to add the lists?
Thanks in advance guys!
I have a problem I can't really seem to get working.
As of now I have a userform where you can input in to textboxes, listbox and adds it to another sheet. That works fine.
Right now i want to give the user "add item" listboxes where they can add multiple items in the left listbox (listbox1) to the right listbox(listbox2). That works fine. What is not working is the transfer from listbox2 to columns. The problem is that people can add 1 or 7 items, so it has to take in to account how many items are added to listbox2. Furthermore it needs to start adding it to column 7.
So 1st line in listbox2 should be at column 7, 2nd line in column 8 and so on. Hope you understand.
Right now i'm using emptyRow to insert the inputs in to the columns right now.
You can see my "add" button here:
Code:
Private Sub tilfoejsag_knap_Click()
Dim emptyRow As Long
'Make Sheet1 active
Worksheets("Automater1").Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Cells(emptyRow, 1).Value = box1.Value
Cells(emptyRow, 2).Value = box2.Value
Cells(emptyRow, 3).Value = box3.Value
Cells(emptyRow, 4).Value = box4.Value
Cells(emptyRow, 5).Value = box5.Value
Cells(emptyRow, 6).Value = box6.Value
Unload Me
Worksheets("Startside").Activate
MsgBox "Sag tilføjet"
End Sub
What can i do to add the lists?
Thanks in advance guys!
Last edited: