对于,如果为true,则如果a = b,则复制

时间:2019-06-13 17:02:01

标签: excel vba

For i = 2 To finalrow
   If Range("J100").End(xlUp).Offset(1, 0).Value = "" & Range("J100").End(xlUp).Offset(1, -3).Value <> "" Then
     If Cells(i, 14) = Vlot Then
       Sheet7.Range(Cells(i, 14)).Copy
       Sheet7.Range("J100").End(xlUp).Offset(1, 0).PasteSpecial xlPasteFormulasAndNumberFormats
     End If
Next i

我不断得到下一个,没有错误。任何帮助都会很棒,谢谢!

1 个答案:

答案 0 :(得分:0)

请尝试这个:)

For i = 2 To 8
   If Range("J100").End(xlUp).Offset(1, 0).Value = "" And Range("J100").End(xlUp).Offset(1, -3).Value <> "" Then
        If Cells(i, 14) = Vlot Then
          Sheet7.Range(Cells(i, 14)).Copy
          Sheet7.Range("J100").End(xlUp).Offset(1, 0).PasteSpecial xlPasteFormulasAndNumberFormats
        End If
    End If
Next i