Doflamingo
Board Regular
- Joined
- Apr 16, 2019
- Messages
- 238
Hi all,
Does anyone know the lines of code that would allow me to put the value of a textbox1 from a userform in the column A just next to the 1st item of the listbox1 that is displayed in the column B ? It drives me crazy..
Here is the code of the listbox 1
Here is the code of the textbox value
But the textbox value is written in column A, line after line AND NOT next to the 1st item of listbox1 that is displayed in the column B
Does anyone know the lines of code that would allow me to put the value of a textbox1 from a userform in the column A just next to the 1st item of the listbox1 that is displayed in the column B ? It drives me crazy..
Here is the code of the listbox 1
Code:
For b = 0 To ListBox1.ListCount - 1
With Sheets("Data")
nextrow = .Range("B" & Rows.Count).End(xlUp).Row + 1
.Range("B" & nextrow) = ListBox1.List(b)
End With
Next
Here is the code of the textbox value
Code:
With Sheets("Data")
arow = .Range("a" & Rows.Count).End(xlUp).Row + 1
.Range("a" & arow) = TextBox1.Value
End With
But the textbox value is written in column A, line after line AND NOT next to the 1st item of listbox1 that is displayed in the column B