Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Hondo Chalthoum    on Oct 03 In MS Office Category.

  
Question Answered By: Bellona Lopez   on Oct 03


This seems to work:

Place the following code  in the "ThisWorkbook" module:

Private Sub Workbook_WindowActivate(ByVal Wn As Window)
MyName = ThisWorkbook.Name
Win1 = MyName & ":1"
Win2 = MyName & ":2"
If Wn.Caption = Win1 Then
Wn.WindowState = xlMaximized
Windows(Win2).Close
End If
End Sub

Then place the following code in a standard module e.g. "Module1":

Sub Button1_Click()
ActiveWindow.NewWindow
Windows.Arrange ArrangeStyle:=xlHorizontal
MyName = ThisWorkbook.Name
Win1 = MyName & ":1"
Win2 = MyName & ":2"
Windows(Win2).Activate
Sheets("Sheet2").Select
End Sub

Next, place a button  on Sheet1 and have the button call the above
macro.

Let me know if this is what you are loking for.

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Code to tile windows horizontally Or get search suggestion and latest updates.


Tagged: