Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to Split Window in Same Place Even If Columns Added or Hidde
The following macro groups and formats a set of text boxes, splits the active
window, and then freezes panes. The SplitColumn and SplitRow properties, however, seem to count only the VISIBLE rows and columns, but I need the window to always split along the top and left of the same named cell called €śWindow_Split_Cell€ť (with a range currently defined as cell D20). It needs to split at this location even if users have added or hidden columns to the left. As it stands, if columns are added or hidden, the macro splits in the wrong place. Sub RegroupObjects() On Error Resume Next ActiveSheet.Shapes.Range(Array("Text Box A", "Text Box B", "Text Box C")). _ Select Selection.ShapeRange.Group.Select Selection.Name = "Project_Info" With Selection .Placement = xlFreeFloating .PrintObject = True .OnAction = "UngroupObjects" End With With ActiveWindow .SplitColumn = 4 'This is the problem line. I've tried .SplitColumn = (Range("Window_Split_Cell")), 'which doesn't do anythiing at all, and ..SplitColumn = (Range("Window_Split_Cell").Column), which runs 'into the same counting-visible-columns-only problem. .SplitRow = 20 End With ActiveWindow.Panes(1).Activate Range("D17:D18").Select ActiveWindow.FreezePanes = True End Sub Help! What am I doing wrong? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot table with added columns for evaluating results | Excel Worksheet Functions | |||
error when running cut & paste macro | Excel Worksheet Functions | |||
i want to open large file 300 col, how to split between worksheets | Excel Discussion (Misc queries) | |||
Macro sorting by 4 columns | Excel Discussion (Misc queries) | |||
Text to columns macro problem | Excel Discussion (Misc queries) |