I use an userform to add new content to a sheet. To add content, I get an ID number (1 to ... let's say 4 for example but it will be used on larger numbers) and I am trying to send data when the condition is fulfilled (the condition being that if the number I put in a combobox on my userform is the same as the one on the sheet, then all the data written on the userform fills the rows below the ID number).
I have been stuck on this for a few hours now and just can't think of another way to do it.
Code
Dim j As Long
Dim lastRow As Long
lastRow = Sheets(2).Cells(Rows.Count, "A").End(xlUp).Row
i = 0
numero = ComboBox_numero.Value 'value of the number ID filled in the combobox
For j = 5 To lastRow
Sheets(5).Cells(1, 2 + i) = Sheets(2).Range("A" & j).Value 'takes the ID number from an other sheet
Select Case numero
Case Is = Sheets(5).Cells(1, 2 + i).Value
'here will be the data sent below the ID number
End Select
i = i + 1
Next
Any help is welcome, I can give more details if needed.