View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Corey Corey is offline
external usenet poster
 
Posts: 363
Default Listbox Select Last Value in range

Is there a line i can ADD to the below code to select the LAST value(not empty) in the Range ?

Private Sub UserForm_Initialize()
Dim myCell As Range
Dim myRng As Range
Set myRng = Worksheets("RTW Plan").Range("N80:N99")
With ListBox1
For Each myCell In myRng.cells
If Trim(myCell.Value) = "" Then
'skip it
Else
.AddItem myCell.Value
End If
Next myCell
End With
End Sub

Corey....