vba: 求一个自定义事件的代码:在a列单元格中输入日期,就会合并 输入日期单元格前几个单元格
1个回答
展开全部
放在sheet 代码窗中
Private Sub Worksheet_Change(ByVal Target As Range)
Application.DisplayAlerts = False
If Target.Column = 1 And Target.Row > 1 And IsDate(Target) Then
Range("A1:A" & Target.Row - 1).Merge
End If
Application.DisplayAlerts = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Application.DisplayAlerts = False
If Target.Column = 1 And Target.Row > 1 And IsDate(Target) Then
Range("A1:A" & Target.Row - 1).Merge
End If
Application.DisplayAlerts = True
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询