tommy1234
02-16-2009, 03:24 PM
hello
i recently create a userfrom (vbmodaless) which has a CommandButton that open a new workbook in excel.
the userform show some information for the user so i change its size.
now, i want to change the userform size each time the user switch between the 2 different workbooks (each workbook has different userform size).
Private Sub CommandButton3_Click()
Dim abc As String, def As String
abc = ActiveWorkbook.name 'get current open workbook name
Application.DisplayAlerts = False
Call sammary_show ' do some calculation
' open a new workbook (the name 'short' is a public string variable)
Workbooks.Open short
Windows(abc).Activate 'activate current window
def = Right(short, 17) & ".xls"
Windows(def).Activate ' activate new workbook window
each switch should have different form size (i hide information).
i tried to do this on "workbook window activate" but had no success.
thanks
i recently create a userfrom (vbmodaless) which has a CommandButton that open a new workbook in excel.
the userform show some information for the user so i change its size.
now, i want to change the userform size each time the user switch between the 2 different workbooks (each workbook has different userform size).
Private Sub CommandButton3_Click()
Dim abc As String, def As String
abc = ActiveWorkbook.name 'get current open workbook name
Application.DisplayAlerts = False
Call sammary_show ' do some calculation
' open a new workbook (the name 'short' is a public string variable)
Workbooks.Open short
Windows(abc).Activate 'activate current window
def = Right(short, 17) & ".xls"
Windows(def).Activate ' activate new workbook window
each switch should have different form size (i hide information).
i tried to do this on "workbook window activate" but had no success.
thanks