If logic where either of two conditions make it true

前端 未结 2 767
渐次进展
渐次进展 2021-01-25 05:01

I am trying to delete a row if cells in column V is not equal to F or V.

This code deletes everything.

For i = RowCo         


        
2条回答
  •  伪装坚强ぢ
    2021-01-25 05:25

    Answer to Else Not working in "If Then Else" in VBA EXCEL

    You need something similar

    Sub SpecificFlatArrears03()
        
        Dim Flat As Variant
        
        Do
            Flat = InputBox("Pl Enter a Flat Number as 3 Digit without Prefix")
            'at this point you should check that Flat meets the required requirements
            Range("h3").Value = Flat
            If (Flat > 100 And Flat < 165) Or (Flat > 200 And Flat < 264) Or (Flat > 300 And Flat < 364) Or Flat = 403 Or Flat = 404 Or Flat = 462 Or Flat = 463 Then
                Range("h4") = WorksheetFunction.Match(Flat, Range("'2020-2021'!d11:d206"), 0)
                Exit Do
            End If
        Loop Until False
        
    End Sub
    

提交回复
热议问题