- 04 Out 2017 às 10:30
#27018
Bom Dia,
Estou tentando colocar a função If Not Intersect para 3 colunas esta dando erro.
Private Sub Worksheet_Change(ByVal Target As Range)
'If Not Intersect(Target, Columns("C")) Is Nothing Then (Preciso acrescentar a coluna F e I )
'For iCol = 2 To Target.Columns.Count
'Set iCell = Target(iRow, iCol)
Plan4.Range("E" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, -2)
Plan4.Range("F" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, 0)
Plan4.Range("C" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = VBA.Environ("username")
Plan4.Range("B" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Now()
'Plan4.Range("A" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = iCell.Address(0, 0)
Plan4.Range("D" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, 7)
'NowValue = Now
'If iLogRow Mod 100 = 0 Then DoEvents
'Next iCol
End If
End Sub
Estou tentando colocar a função If Not Intersect para 3 colunas esta dando erro.
Private Sub Worksheet_Change(ByVal Target As Range)
'If Not Intersect(Target, Columns("C")) Is Nothing Then (Preciso acrescentar a coluna F e I )
'For iCol = 2 To Target.Columns.Count
'Set iCell = Target(iRow, iCol)
Plan4.Range("E" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, -2)
Plan4.Range("F" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, 0)
Plan4.Range("C" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = VBA.Environ("username")
Plan4.Range("B" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Now()
'Plan4.Range("A" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = iCell.Address(0, 0)
Plan4.Range("D" & Cells(Rows.Count).Row).End(xlUp).Offset(1, 0).Value = Target.Offset(0, 7)
'NowValue = Now
'If iLogRow Mod 100 = 0 Then DoEvents
'Next iCol
End If
End Sub