- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 255
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-24
|
¦^´_ 3# bridetobe
¸Õ¸Õ¬Ý¬O§_²Å¦X?- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim A As Range
- If Target.Column <> 2 Then Exit Sub
- With ¤u§@ªí2
- ThisWorkbook.Names.Add "²M³æ", "=OFFSET(" & .Name & "!$A$1,,,COUNTA(" & .Name & "!$A:$A))" '«Ø¥ß°ÊºA½d³ò¦WºÙ°µ¬°²M³æ
- Set A = .Cells(.Rows.Count, 1).End(xlUp).Offset(1) '²M³æ¤U¤@®æ
- End With
- With Target
- Select Case .Value
- Case "·s¼W"
- newitem = InputBox("¿é¤J·s¼W¶µ¥Ø")
- If IsError(Application.Match(newitem, [²M³æ], 0)) Then A.Value = newitem Else MsgBox newitem & "¤w¦b²M³æ¤º": Exit Sub
- With .EntireColumn.Validation
- .Delete
- .Add xlValidateList, , Formula1:="=" & [²M³æ].Address(, , , 1)
- End With
- Target = newitem
- Case "§R°£"
- delitem = InputBox("¿é¤J§R°£¶µ¥Ø")
- Set A = [²M³æ].Find(delitem, lookat:=xlWhole)
- If A Is Nothing Then
- MsgBox delitem & "¥¼¦b²M³æ¤º"
- Else
- A.Delete xlShiftUp
- With .EntireColumn.Validation
- .Delete
- .Add xlValidateList, , Formula1:="=" & [²M³æ].Address(, , , 1)
- End With
- End If
- End Select
- End With
- End Sub
½Æ»s¥N½X |
|