Advertisement
dave3009

DarioQ_EFF

Oct 6th, 2022
1,523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub UserForm_Initialize()
  2. Dim i As Long
  3. Dim c As Byte
  4. Dim lstRw As Long
  5. Dim Sg As Worksheet
  6. Set Sg = ThisWorkbook.Sheets("Data")
  7. lstRw = Sg.Range("U" & Rows.Count).End(xlUp).Row
  8. For c = 65 To 90
  9.     For i = 2 To lstRw
  10.         If UCase(Sg.Cells(i, 1)) = Chr(c) Then
  11.             Me.ListBox1.AddItem Sg.Cells(i, 1)
  12.         End If
  13.   Next i
  14. Next c
  15. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement