mardi 21 juin 2016

application defined or object defined error, need answer asap plz

whenever i try to run this code i get that error on the if statement and i don't know why, please be advicsed that rcolor and info are defined and work perfectly i just chose not to put them here since they are quite long and won't affect the question in any way and M8 is brought from a different sub

Sub Schedule(M8 As Variant)
If eTime = "900" Then
retry1:
If IsEmpty(Cells(8, M8).Value) And IsEmpty(Cells(12, M8).Value) = True Then
    Sheets("Schedule").Cells(8, M8).Value = info
    Sheets("Schedule").Range(Cells(9, M8), Cells(12, M8)).Value = ","
    Sheets("Schedule").Range(Cells(8, M8), Cells(12, M8)).Interior.Color = rcolor
    Sheets("Schedule").Range(Cells(8, M8), Cells(12, M8)).BorderAround Weight:=xlMedium
    M8 = M8 + 1
Else
    M8 = M8 + 1
    GoTo retry1
End If

someone told me that i need to qualify my if statement line and told me to add With Sheets("Schedule") ... end with and i tried that but still no luck

i've been stuck on this issue for quite a long time and would appreciate any help, thnx in advance.

Aucun commentaire:

Enregistrer un commentaire