jhnnyboz
04-07-2012, 12:05 PM
What i did is compare an array with a spreadsheet column, then if they are equal it saves it as 1. Then when the user opens the user form and clicks a button it goes through the comparisn and if it sees that its = 1 then it will change the backround color of a label on the object.
but it seems that the array and object's label are dimmed differently or something, cause i am getting an error of object variable or with block variable not set. please help
heres the code
Private Sub CommandButton3_Click()
Dim i As Variant
Dim s As Object
For i = 100 To 883
If check(i) = 1 Then
s = slist(i)
With s
.BackColor = RGB(0, 500, 0)
End With
End If
Next i
End Sub
oh by the way i have the slist() array saved as a global variant in the module.
when i saved the slist () as a global object then i get an error when i fill the array. i have not dimmed anything an object before so please explain
but it seems that the array and object's label are dimmed differently or something, cause i am getting an error of object variable or with block variable not set. please help
heres the code
Private Sub CommandButton3_Click()
Dim i As Variant
Dim s As Object
For i = 100 To 883
If check(i) = 1 Then
s = slist(i)
With s
.BackColor = RGB(0, 500, 0)
End With
End If
Next i
End Sub
oh by the way i have the slist() array saved as a global variant in the module.
when i saved the slist () as a global object then i get an error when i fill the array. i have not dimmed anything an object before so please explain