Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
PBJ PBJ is offline
external usenet poster
 
Posts: 19
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot table with added columns for evaluating results Ekazakoff Excel Worksheet Functions 5 September 22nd 06 02:56 AM
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
i want to open large file 300 col, how to split between worksheets bluelagoon_HP Excel Discussion (Misc queries) 5 July 29th 06 12:28 AM
Macro sorting by 4 columns dcbpe Excel Discussion (Misc queries) 2 June 27th 06 02:52 PM
Text to columns macro problem Andy Excel Discussion (Misc queries) 4 June 20th 06 02:10 PM


All times are GMT +1. The time now is 02:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"