- ©«¤l
- 250
- ¥DÃD
- 59
- ºëµØ
- 0
- ¿n¤À
- 313
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¿Dªù
- µù¥U®É¶¡
- 2010-9-11
- ³Ì«áµn¿ý
- 2020-1-6
|
¥»©«³Ì«á¥Ñ ©P¤j°¶ ©ó 2014-12-10 18:46 ½s¿è
·PÁ¨â¦ì¼Ó¥D¦^À³, ¥ý¦æÁ¹L,
¤p§Ì¯uªº¨Sªk§â²{¨Ï¥Îªºµ{¦¡»P¨â¦ì¤j¤j©Ò¨Ñªºµ{¦¡¿Ä¦X, ²{§â¨Ï¥Î¶}ªºµ{¦¡¶K¤W, ½Ð¨â¦ì¼Ó¥D¨ó§U, ÁÂÁÂ!!
Private Sub Worksheet_Change(ByVal T As Range)
Dim Rng As Range, A As Range, Dha As Workbook, pp
Application.EnableEvents = False
Set Dha = Workbooks("sssÜ®w¸ê®Æ.xlsm")
Set Rng = Dha.Sheets(1).UsedRange
Select Case T.Column
Case 2
If IsDate(T) Then T.Offset(, -1) = Month(T)
Case 3
Set A = Rng.Columns(2).Find(T, lookat:=xlWhole)
If A Is Nothing Then MsgBox "µL¦¹³fª«½s¸¹": GoTo 10
T.Offset(, 1) = A.Offset(, 1)
T.Offset(, 2) = A.Offset(, 2)
T.Offset(, 3) = A.Offset(, 3)
T.Offset(, 5) = A.Offset(, 4)
Case 7
Set A = Rng.Columns(2).Find(T.Offset(, -4), lookat:=xlWhole)
pp = Application.SumIf(Range("C:G"), A, Range("G:G")) 'pºâÜ®w´£¨úÁ`¼Æ
If pp > (A.Offset(, 8) + A.Offset(, 10)) Then
MsgBox T.Offset(, -3) & "¦s¶q¤£¨¬«·s¶ñ¼g"
T.Interior.ColorIndex = 26
GoTo 10
End If
T.Interior.ColorIndex = xlNone
pp = Application.SumIf(Range("C:G"), T.Offset(, -4), Range("G:G")) 'pºâÜ®w´£¨úÁ`¼Æ
A.Offset(, 8) = pp
A.Offset(, 10) = A.Offset(, 7) + A.Offset(, 9) - A.Offset(, 8)
T.Offset(, 2) = T * T.Offset(, 1)
Dha.Save
End Select
10
Application.EnableEvents = True
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal T As Range, Cancel As Boolean)
Dim A As Range
If Not Application.Intersect(T, Range("A3:L" & Application.CountA([A3:A6]) + 2)) Is Nothing Then
Cancel = True
With Workbooks("sssÜ®w¸ê®Æ.xlsm")
Set A = .Sheets(1).UsedRange.Columns(2).Find(Range("C" & T.Row), lookat:=xlWhole)
If A.Column <> 2 Or A = "" Then
MsgBox "¸ê®Æ¤£¥¿½T ½Ð¬d©ú"
Range(Cells(T.Row, "A"), Cells(T.Row, "L")).Select
Exit Sub
End If
If MsgBox(Range("C" & T.Row) & " " & Range("D" & T.Row) & Chr(10) _
& "¨ú®ø " & [G2] & " " & Range("G" & T.Row) & Chr(10) & "½Ðª`·N [¥»¬ö¿ý] ¨ú®ø«áµLªk´_ì", vbYesNo) = vbYes Then
Application.ScreenUpdating = False
Application.EnableEvents = False
A.Offset(, 8) = Application.SumIf(Range("C:C"), A, Range("G:G")) - Range("G" & T.Row) 'Åܧó¤J³fÁ`¼Æ©ó¸ê®Æ®w
A.Offset(, 10) = A.Offset(, 7) + A.Offset(, 9) - A.Offset(, 8)
.Save
Range(Cells(T.Row, "A"), Cells(T.Row, "L")).Delete (3)
Application.EnableEvents = True
ActiveWorkbook.Save
Application.ScreenUpdating = True
End If
End With
End If
End Sub |
|