多条if条件下的VBA代码

时间:2018-03-22 18:21:12

标签: excel vba excel-vba

我需要将数据分类到不同的存储桶中。我的工作表有V&列;列Y(实际上分别是名称匹配和地址匹配)具有“ok”或“check”的值。列O有ID,其中一些只是数字,一些是字母数字。我需要根据这3列填充我的列A.

类别1 - 要填充“验证名称和地址”的A列 - 其逻辑是 - 如果A列为空白,则列V值=“检查”,列Y值=“检查”,列O =所有字母数字ID(以CWT开头除外)和数字ID = 2& 9612

类别2 - 要填充“验证地址”的列A - 逻辑是 - 如果列A为空,列V值=“ok”,列Y值=“检查”,列O =所有字母数字ID (除了从CWT开始)和数字ID = 2& 9612.

Sub Rules()
'
'Autofill based on Rules

Worksheets("ORD_CS").Activate
Dim sht As Worksheet
Dim LR As Long
Dim i As Long

Set sht = ActiveWorkbook.Worksheets("ORD_CS")
LR = sht.UsedRange.Rows.Count


    With sht
      For i = 8 To LR
            If .Range("A" & i).Value = "" And Range("V" & i).Value = "check" And Range("Y" & i).Value = "check" And Range("O" & i).Value = "2" And Range("O" & i).Value = "9612" Then
                .Range("D" & i).Value = "Verify Name & Address"
            End If
        Next i
   End With
End Sub

我还没有完成我的代码。有人可以帮忙吗?谢谢

1 个答案:

答案 0 :(得分:0)

以下应该可行,我将您的O列更改为OR

编辑:功能

let input = AVAssetWriterInput(mediaType: AVMediaTypeVideo, outputSettings: [AVVideoCodecKey: AVVideoCodecJPEG,
                                                                                         AVVideoHeightKey: correctedContentSize.height,
                                                                                         AVVideoWidthKey: correctedContentSize.width,
                                                                                         AVVideoExpectedSourceFrameRateKey: 60])

相关问题