Results 1 to 11 of 11

Matching formula Problem with OR function

Threaded View

  1. #1
    Registered User
    Join Date
    04-15-2009
    Location
    Israel
    MS-Off Ver
    Excel 2019
    Posts
    79

    Exclamation Matching formula Problem with OR function

    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
    Last edited by Shark Man; 07-21-2010 at 12:44 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1