April 2006
Beginner
1114 pages
98h 16m
English
windows.CompareSideBySideWith(WindowName)
Starts side-by-side comparison between the active window and another window. Side-by-side comparison links the scrolling of the two windows so that you can more easily compare different versions of a workbook. Use BreakSideBySide to turn off this comparison.
The following code demonstrates turning side-by-side comparison on and off. Ordinarily, you would open two existing versions of a workbook, but I create the second version here so that the demonstration is self-contained:
Sub TestBeginSideBySide( )
Dim fpath As String, wnd As Window
' Get the window for active workbook.
Set wnd = Application.ActiveWindow
' Get the workbook's full filename.
fname = ActiveWorkbook.Path & "\" & ActiveWorkbook.name
' Change it to a new filename.
fname = VBA.Replace(fname, ".xls", "_v2.xls")
' Save a copy of the workbook.
ActiveWorkbook.SaveCopyAs fpath
' Open the copy (makes the copy the active window).
Application.Workbooks.Open fname
' Turn on side-by-side comparision.
Application.Windows.CompareSideBySideWith wnd.Caption
End Sub
Sub TestEndSideBySide( )
' Turn off side-by-side comparision.
Application.Windows.BreakSideBySide
End SubRead now
Unlock full access