Sub 開啟輸入表單()
p = ThisWorkbook.Path
Filename = "b.xlsm"
Dim w As Workbook, c As Boolean
For Each w In Workbooks
If LCase(w.Name) = Filename Then c = True: Exit For
Next
If Not c Then Workbooks.Open Filename:=p & "\" & Filename
Workbooks(Filename).UserForm1.Show
End Sub作者: GBKEE 時間: 2011-7-17 13:47
回復 1#minshing
Private Sub Ex() 'b檔 建一私用巨集
UserForm1.Show
End Sub
Run "b檔!ThisWorkbook.Ex" 'b檔的巨集 如在物件模組(如是 ThisWorkbook )
Run "b檔!Ex" 'b檔的巨集 如在一般模組(Module1 )作者: minshing 時間: 2011-7-17 14:28