发布网友 发布时间:2022-05-07 10:22
共2个回答
热心网友 时间:2023-10-25 21:35
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ym As Integer
If Target.Count = 1 And Target.Column = 2 Then
ym = Format(Date, "yymm")
Application.EnableEvents = False
If Len(Target.Value) < 5 Then
Target = ym & WorksheetFunction.Rept("0", 4 - Len(Target.Value)) & Target.Value
End If
Application.EnableEvents = True
End If
End Sub
热心网友 时间:2023-10-25 21:35
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ym As Integer
If Target.Count = 1 And Target.Column = 2 Then
ym = Format(Date, "yymm")
Application.EnableEvents = False
If Len(Target.Value) < 5 Then
Target = ym & WorksheetFunction.Rept("0", 4 - Len(Target.Value)) & Target.Value
End If
Application.EnableEvents = True
End If
End Sub
热心网友 时间:2023-10-25 21:35
Private Sub Worksheet_Change(ByVal Target As Range)热心网友 时间:2023-10-25 21:35
Private Sub Worksheet_Change(ByVal Target As Range)