When I am using "AND" condition an error saying "run time error 1004, method range of object global failed" occurs. My code is working fine if I remove and condition may be there is wrong use of "and" Pls any help will be great support. Thanks
Private Sub okButton_Click()
Dim i As Double, dt1 As String, dtt1 As String
Dim dt2 As String, dtt2 As String
dt1 = ComboBox1.Value
dtt1 = CDate(dt1)
dt2 = ComboBox2.Value
dtt2 = CDate(dt2)
Debug.Print dtt2
For i = 2 To 6724
If Range("A" & i).Value >= dtt1 And Range("A", i).Value <= dtt2 Then
Rows(i).Select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
End If
Next
End Sub