Forum

Split into Sheets t...
 
Notifications
Clear all

Split into Sheets then Files

2 Posts
2 Users
0 Reactions
84 Views
(@marsil)
Posts: 72
Estimable Member
Topic starter
 

Hi,

I use attached macro to Split into Sheets then Files, Please can you help to copy Freeze Panes and Zoom to other sheets.

Thanks;

Marsil 

 
Posted : 23/12/2021 6:27 pm
(@catalinb)
Posts: 1937
Member Admin
 

Hi Marsil,

These parameters are based on the window, not on the sheet, so you have to store the parameters from the source while it's active, then activate the destination sheet and apply the same settings.

Dim CheckPanes as Boolean, RowSplit as Long, ColSplit as Long, ZoomLevel as Long

'Collect info:

ZoomLevel=ActiveWindow.Zoom

CheckPanes=ActiveWindow.FreezePanes 'I assume that you have the source sheet active at this point, make sure it is

If CheckPanes=True then

RowSplit=ActiveWindow.SplitRow

ColSplit=ActiveWindow.SplitColumn

End If

'Now, activate the target destination sheet:

Windows("FileName Here.xlsx").Activate
Worksheets("SheetName").Activate

'transfer the settings:

With ActiveWindow
.Zoom = ZoomLevel
If CheckPanes =True Then
.SplitRow = RowSplit
.SplitColumn = ColSplit
.FreezePanes = True
End If
End With

 
Posted : 25/12/2021 12:17 am
Share: