I have a code that worked for years, but all of a sudden it does NOT. Not even the backups that I save. This leads me to believe it is something on my machine or an Excel update I'm unfamiliar with. BUT, it is a hufe pain and I can't figure it out. The code populates a listbox. (I have another code that is doing the same thing...aagghh!)
This is the bit of code the debugger catches up on with an "Application-defined or Objdect-defined" error
This is the code it is emmbedded in:
This is the bit of code the debugger catches up on with an "Application-defined or Objdect-defined" error
Code:
.Rows.Hidden = False
This is the code it is emmbedded in:
Code:
Sub Populating_ListBox_withExtractedDATA_2()
Application.ScreenUpdating = False
Dim r, LastRow As Long
Dim Cname, Ccode As String
Dim i As Integer
With ThisWorkbook.Worksheets("SOMs")
.Rows.Hidden = False
.Columns.Hidden = False
.ListBox1.Clear 'clear all existing list box items
LastRow = Cells(Rows.count, 1).End(xlUp).Row
Rows(1 & ":" & LastRow).Hidden = False
i = 0
For r = 1 To LastRow
If Cells(r, 3).Value = Cname Then GoTo a
If Cells(r, 1) = "COURSE TITLE:" Then
Cname = Cells(r, 3)
Ccode = Mid(Trim(Cells(r, 3).Offset(4, 14)), 1, 3)
ColumnCount = 2
.ListBox1.AddItem
.ListBox1.List(i, 0) = Cname
.ListBox1.List(i, 1) = Ccode
i = i + 1
End If
a:
Next r
End With
Application.ScreenUpdating = True
End Sub
Last edited: