Hello, can anybody help with this?
I have a list box that I want populated by extracted date from this code:
The above produces a list of about 12 course titles in column 37, and are what I want added to my list box.
I thought that maybe I should insert .Additem something like this:
I have yet to get it to work. Any help would be appreciated - thanks - Jim A
I have a list box that I want populated by extracted date from this code:
Code:
Sub Listing_Cousrse_Titles()
Application.ScreenUpdating = False
Dim r, a, Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
a = 6
If Cells(a, 37) <> xlnull Then
MsgBox ("Proceedure already performed.")
Exit Sub
End If
For r = 1 To Lastrow
If Cells(a, 37) <> xlnull Then a = a + 1
If Cells(r, 1) = "COURSE TITLE:" Then Cells(a, 37) = Cells(r, 3)
If Cells(a, 37) = Cells(a - 1, 37) Then Cells(a, 37).Delete
Next r
Application.ScreenUpdating = True
End Sub
I thought that maybe I should insert .Additem something like this:
Code:
Sub Listing_Cousrse_Titles()
Application.ScreenUpdating = False
Dim r, a, Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
a = 6
If Cells(a, 37) <> xlnull Then
MsgBox ("Proceedure already performed.")
Exit Sub
End If
For r = 1 To Lastrow
If Cells(a, 37) <> xlnull Then a = a + 1
If Cells(r, 1) = "COURSE TITLE:" Then Cells(a, 37) = Cells(r, 3)
[SIZE=3][B]Sheets(1).listbox1.additem(cells(r, 3).value)[/B][/SIZE]
If Cells(a, 37) = Cells(a - 1, 37) Then Cells(a, 37).Delete
Next r
Application.ScreenUpdating = True
End Sub