|
Private Sub Worksheet_BeforeDoubleClick(ByVal T As Range, Cancel As Boolean)
If T.Row > 4 And T.Column = 1 Then
If T.Count > 1 Then End
If InStr(T.Value, "清单") = 0 Then End
Cancel = True
If T.Offset(1) = "计价" Then
w = MsgBox("清单已经存在,是否删除下面的清单?", vbYesNo)
If w = vbNo Then End
r = Cells(Rows.Count, 1).End(xlUp).Row
For i = T.Row + 1 To r
If InStr(Cells(i, 1), "清单") > 0 Then
js = i
Exit For
End If
Next i
If js = "" Then
js = r
Else
js = js - 1
End If
Rows(T.Row + 1 & ":" & js).Delete
Else
w = MsgBox("是否新增一个固定模板?", vbYesNo)
If w = vbNo Then End
Rows("5:15").Select
Selection.Copy
Rows(T.Row + 1).Select
Selection.Insert Shift:=xlDown
hh = T.Offset(, 1).Value
For i = T.Row + 2 To T.Row + 11
m = m + 1
Cells(i, 2) = hh & "." & m
Next i
End If
End If
End Sub
|
|