Hello Experts
I have a program that check each line and return true or false within the date criteria
Something wrong with the formula "or" can someone look at this
Thanks
![]()
ub hul() Dim currentsheet As String Dim LR As Long currentsheet = InputBox("month/year", "month/year") LR = Range("A" & Rows.Count).End(xlUp).Row Range("I2").Select ActiveCell.FormulaR1C1 = "=MONTH(RC[-3])&YEAR(RC[-3])" Range("I2").Select Selection.AutoFill Destination:=Range("I2:I" & LR) Range("I1").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "month/year of departure" Columns("I:I").ColumnWidth = 13 LR = 0 LR = Range("A" & Rows.Count).End(xlUp).Row Range("j2").Select ActiveCell.FormulaR1C1 = "=MONTH(RC[-3])&YEAR(RC[-3])" Range("j2").Select Selection.AutoFill Destination:=Range("j2:j" & LR) Range("j1").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "month/year of arrival" Columns("J:J").ColumnWidth = 13 LR = 0 LR = Range("A" & Rows.Count).End(xlUp).Row Range("K2").Select ActiveCell.FormulaR1C1 = "=OR(RC[-2])=currentsheet,OR(RC[-1])=currentsheet" Range("K2").Select Selection.AutoFill Destination:=Range("K2:K" & LR) Range("K1").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "Match" Columns("K:K").ColumnWidth = 13 LR = 0 End Sub











LinkBack URL
About LinkBacks
Register To Reply

Bookmarks