...修改下面的VBA代码,做到如果C列中有数据,保留不变,没有,按条件输入...
发布网友
发布时间:2024-04-09 04:52
我来回答
共2个回答
热心网友
时间:2024-04-18 07:55
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 1 Or Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Select Case Target.Column
Case Is = 7
If Target.Value > 0 Then
With Target.Offset(0, -4)
If .Value > 0 Then
Else
If Target.Offset(0, -6) = Target.Offset(-1, -6) Then .Value = Target.Offset(-1, -4).Value
End If
If .Value > 0 Then
Else
.Value = Now
.NumberFormatLocal = "yyyy-m-d h:mm;@"
End If
End With
End If
End Select
Application.EnableEvents = True
End Sub
热心网友
时间:2024-04-18 07:53
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 And Target.Row > 1 And Target = "*" Then
Cells(Target.Row, 1) = Cells(Target.Row, 3)
End If
End Sub