|
難しく考えないで、この方が簡単見たい?
'<ThisBook>----------
Option Explicit
Private Sub Workbook_Open()
SCkey
End Sub
'<フォーム:A_window>----------
Option Explicit
Private Sub B_dush_Click()
lngSelect = 1
Unload Me
End Sub
Private Sub C_dush_Click()
lngSelect = 2
Unload Me
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
lngSelect = 0
End If
End Sub
'<フォーム:B_window>----------
Option Explicit
Private Sub A_project_Click()
lngSelect = 0
Unload Me
End Sub
Private Sub C_projecr_Click()
lngSelect = 2
Unload Me
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
lngSelect = 1
End If
End Sub
'<フォーム:C_window>----------
Option Explicit
Private Sub A_cat_Click()
lngSelect = 0
Unload Me
End Sub
Private Sub B_cat_Click()
lngSelect = 1
Unload Me
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
lngSelect = 2
End If
End Sub
'<標準モジュール>----------
Option Explicit
Public lngSelect As Long
Sub SCkey()
Application.OnKey "%^{F12}", "MYshow"
End Sub
Sub MYshow()
Select Case lngSelect
Case 0
A_window.Show
Case 1
B_window.Show
Case 2
C_window.Show
End Select
End Sub
|
|