- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¦^´_ 17# owen06
½Ð§Aª½±µ¶}±Ò #1 ªºªþ¥ó¡AµM«á±N¥H¤Uµ{¦¡½X¶K¤J¨ì Sheet2 ªºµ{¦¡½X°Ï¦A¸Õ¸Õ¬Ý (§¹¥þ½Æ»s¹L¥h)¡A
µ²ªG¦p¦ó½Ð¦^´_§iª¾¡AÁÂÁ¡I (§Ú³oÃäµL½×¬O¥t¦æ·s¼W¡B©ÎªÌ¬O¨Ï¥Î #1 ªºªþ¥ó³£¬OOKªº )- Public ckCurr As Boolean
- Private Sub ComboBox1_Change() ' stillfish00 ´£¨Ñ
- If ckCurr Then Exit Sub
-
- Application.EnableEvents = False
-
- ckCurr = False
- ComboBox1.Visible = False
- Range(ComboBox1.LinkedCell).Offset(, 2).Select
- Application.EnableEvents = True
- End Sub
- Private Sub CommandButton1_Click()
- If Me.ComboBox1.Visible Then ckCurr = True: Me.ComboBox1.Visible = False
-
- Range("A2:A25,C2:C25").Select
- Selection.ClearContents
- End Sub
- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- Dim StrVdFml As String
-
- ' If ckCurr Then Exit Sub
- On Error Resume Next
- StrVdFml = Replace(ActiveCell.Validation.Formula1, "=", "")
- ' ActiveCell.Validation.Formula1 ¡G "=Sheet1!$A$3:$A$20"
- ' ComboBox1.ListFillRange ¡G Sheet1!$A$3:$A$20
- ' Replace(ActiveCell.Validation.Formula1, "=", "") : "Sheet1!$A$3:$A$20"
- ' StrVdFml : "Sheet1!$A$3:$A$20"
- ActiveCell.Validation.InCellDropdown = False
- On Error GoTo 0
- If StrVdFml = "" Then
- If Me.ComboBox1.Visible Then Me.ComboBox1.Visible = False
- Else
- With Me.ComboBox1
- ' ComboBox1.progID =EMBED("Forms.ComboBox.1","")
- ' ComboBox1¡G ComboBox
- ' LinkedCell¡G $A$2
- ' ListFillRange ¡G Sheet1!$A$3:$A$20
- .Left = ActiveCell.Left
- .Top = ActiveCell.Top
- ' .Width = ActiveCell.Width + 140
- .Width = ActiveCell.Width
- ' .Height = ActiveCell.Height + 10
- .Height = ActiveCell.Height
- ' .Font.Size = 22
- .Font.Size = 12
- .LinkedCell = ActiveCell.Address ' "$A$2"
- .ListFillRange = StrVdFml ' "Sheet1!$A$3:$A$20"
- .Visible = 1 ' Åã¥Ü¤U©Ô²Å¸¹
- .Object.SpecialEffect = 3
- '.Object.Font.Size = ActiveCell.Font.Size
- End With
- End If
-
- ckCurr = False
- End Sub
- Private Sub Worksheet_Change(ByVal Target As Range)
- ' Target.Font.ColorIndex = 5
-
- If Not Intersect(Target, Range("C2:C25")) Is Nothing Then
- If Target(1, 1) = 0 Then Exit Sub
- ckCurr = True
- ' MsgBox Target.Address
- Target.Offset(1, -2).Select
- End If
- End Sub
- Sub CellValidation() ' stillfish00 ´£¨Ñ
- With Sheets("Sheet2").[A2:A25].Validation
- .Delete
- .Add Type:=xlValidateList, Formula1:="=Sheet1!$A$3:$A$20"
- End With
- End Sub
½Æ»s¥N½X |
|