Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello,
I'd like to excel to transfer items = list of names from my userform listbox to specific range in excel sheet e.g A1:K1 and sort the names alfabetically. I'd also like excel to remove a name from the range when removed from listbox.
Help is greatly appreciated. So for I've got this...
Regards, Mark
I assume that this should be columns instead of rows. I've tried it but can't get it to work...
Private Sub OKButton_Click()
Dim LastRow As Long
LastRow = Range("A65536").End(xlUp).row + 1
Range("A" & LastRow).Value = ListBox2.TextUnload Me
End Sub
--------
I assume that this should be columns instead of rowsSub ShowDialog()
Dim row As Integer
UserForm1.ListBox2.RowSource = ""' Add some items to the ListBox
For row = 1 To 42
UserForm1.ListBox2.AddItem Sheets("Sheet1").Cells(row, 1)
Next row
UserForm1.Show
End Sub

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |