I am having a little trouble with the following code...
The following line raises the error object variable not set! I am referencing two distinct worksheet through this code...
Can anyone spot what I am doing wrong with regards to working across multiple objects and how to better set and declare them?
Any advice would be awesome,
Thanks in advance,
The following line raises the error object variable not set! I am referencing two distinct worksheet through this code...
x = PLATFORM.UsedRange.Rows.Count
Can anyone spot what I am doing wrong with regards to working across multiple objects and how to better set and declare them?
Any advice would be awesome,
Thanks in advance,
Code:
Sub GroupListUpdate()
ApplicationScreenUpdating = False
Dim PLATFORM As Worksheet
Dim GROUPLIST As Worksheet
x = PLATFORM.UsedRange.Rows.Count
For iRow = 1 To x
If PLATFORM.Cells(iRow, 3).Interior.ColorIndex = 15 Then
iGroup = PLATFORM.Cells(iRow, 3).Text
With GROUPLIST.Range("A1:A" & Rows.Count)
Set c = .Find(iGroup, LookIn:=xlValues)
' TRYING TO FIND the Text of datae represented earlier!
If c Is Nothing Then
' IF WE CAN'T FIND IT, then insert iGroup..
theRow = GROUPLIST.Cells.Find("", .Cells(1, 1), xlFormulas, _
xlWhole, xlByColumns, xlNext).Row
' This finds a row starting from top that is empty to put the new values in!!!
GROUPLIST.Cells(theRow, 1).Value = iGroup
End If
End With
End If