Hi,
when I open my excel file i've got this error
If I run stop the macro and run it again, I have no problem.
Why?
when I open my excel file i've got this error
and this lineRun Time error 13
Type Mismatch
of this structureIf .Value >= TimeSerial(9, 0, 0) And .Value < TimeSerial(9, 5, 0) Then
is underlined.If .Value >= TimeSerial(7, 0, 0) And .Value < TimeSerial(7, 30, 0) Then
With ThisWorkbook
Worksheets("Sheet1").Range("B2").Copy
Worksheets("Sheet2").Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial xlValues
End With
If (myEnter = 0) Then
myEnter = 1
End If
End If
If I run stop the macro and run it again, I have no problem.
Why?