Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim r, c, n
With Target
r = .Row: c = .Column: n = .Count
End With
With ListBox1
If r > 4 And r < 58 And c > 3 And c < [ai1].Column And r Mod 2 = 1 And n = 1 Then
.Left = Cells(r, c + 1).Left
.Top = Cells(r, c).Top
.Visible = True
Else
.Visible = False
End If
End With
End Sub
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
ActiveCell.Value = ListBox1.Text
ActiveCell.Select
ListBox1.Visible = False
End Sub
Private Sub Workbook_Open()
With Sheets(1).ListBox1
.List = Sheets(1).Range("AQ5:AQ34").Value
.Height = .ListCount * 10 '自动调整行高
End With
End Sub
15年10月考勤(翁忠明)4.rar
(42.5 KB, 下载次数: 6)