1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Private Sub UserForm_Activate()
Dim hWnd As Long, Style As Long
hWnd = FindWindow(vbNullString, Me.Caption)
Style = GetWindowLong(hWnd, -16) And Not &HC00000
SetWindowLong hWnd, -16, Style
DrawMenuBar hWnd
ahbon
End Sub
Private Sub ListBox1_Click()
Worksheets(ListBox1.List(ListBox1.ListIndex)).Select
ahbon
End Sub
Private Sub ahbon()
With Me
H = Application.Height
L = Application.Width
.Move 20, H - 20, L - 40, 30
.Frame1.Caption = ""
.Frame1.BorderStyle = 0
.Frame1.Move 0, 0, L - 40, H - 40
.Label1.Move 0, 0, 400, H - 40
.Label1.Caption = " Sélectionnez une feuille dans la liste déroulante ci-contre ===>>>"
.Label1.Font.Bold = True
.Label1.Font.Size = 10
.ListBox1.Move 410, 0, L - 500, 30
For Each Sh In Worksheets
.ListBox1.AddItem Sh.Name
Next
End With
End Sub |
Partager