Asalamo Alaikum Dear Razak I am following once of your video, "Listbox autoupdate column count AND transfer data to sheets only selected item" I wrote your code with my worksheet setting, Private Sub CommandButton1_Click() Dim MyRow As Range, MyColum As Byte Dim i As Long For i = 0 To UserForm4.ListBox1.ListCount - 1 Set MyRow = Sheet10.Range("A100000").End(xlUp).Offset(1, 0) If UserForm4.ListBox1.Selected(i) = True Then MyRow = UserForm4.ListBox1.List(i) For MyColum = 1 To Application.WorksheetFunction.CountA(Sheet10.Range("A6:K6")) MyRow.Offset(0, MyColum) = UserForm4.ListBox1.List(i, MyColum) Next MyColum End If UserForm4.ListBox1.Selected(i) = False Next i End Sub But unfortunately, I is only transferring 3 columns into my next sheet. Can you please help me to sort out this??? Mohammad Arshad
Asalamo Alaikum
ReplyDeleteDear Razak
I am following once of your video, "Listbox autoupdate column count AND transfer data to sheets only selected item"
I wrote your code with my worksheet setting,
Private Sub CommandButton1_Click()
Dim MyRow As Range, MyColum As Byte
Dim i As Long
For i = 0 To UserForm4.ListBox1.ListCount - 1
Set MyRow = Sheet10.Range("A100000").End(xlUp).Offset(1, 0)
If UserForm4.ListBox1.Selected(i) = True Then
MyRow = UserForm4.ListBox1.List(i)
For MyColum = 1 To Application.WorksheetFunction.CountA(Sheet10.Range("A6:K6"))
MyRow.Offset(0, MyColum) = UserForm4.ListBox1.List(i, MyColum)
Next MyColum
End If
UserForm4.ListBox1.Selected(i) = False
Next i
End Sub
But unfortunately, I is only transferring 3 columns into my next sheet.
Can you please help me to sort out this???
Mohammad Arshad