Using Excel 2013.
I have a runtime error 424, and the code will stop at the IF line. What is wrong with the code?
Sub test ()
Option explicit
dim ThisPeriod , LastPeriod as string
ThisPeriod = Range("B3")
LastPeriod = Range("B6")
If Left(ThisPeriod, 1).Text = "S" And Left(LastPeriod, 1).Text = "J" Then
Do some actions
Else
Do some actions
End If
End Sub
I have a runtime error 424, and the code will stop at the IF line. What is wrong with the code?
Sub test ()
Option explicit
dim ThisPeriod , LastPeriod as string
ThisPeriod = Range("B3")
LastPeriod = Range("B6")
If Left(ThisPeriod, 1).Text = "S" And Left(LastPeriod, 1).Text = "J" Then
Do some actions
Else
Do some actions
End If
End Sub