Omgili, forum search, forums search, search forums, discussion search,discussions search, search discussions, board search, boards search, search boards
  Advanced Search

Center displayed columns in middle of window

On Thu, 4 Jun 2009 21:39:01 -0700, dgold82 <...@discussions.microsoft.com

I have a worksheet that only contains 5 columns. The rest are hidden. Is
there a way to center the displayed columns in the middle of my screen when
excel is maximized. Think about if you go to weather.com--my 17 inch laptop
screen can probably display almost 2 explorer screens side by side but if you
maximize the screen the webpage is centered.

I would like to do this in my excel worksheet page when maximized.
Basically, center the 5 columns that I need so that they aren't anchored to
the left when I work in full screen mode or when maximized. Don't know if
this is possible, but I figured it couldn't hurt to ask.

Thanks.



On Thu, 4 Jun 2009 22:13:01 -0700, Jacob Skaria <...@discussions.microsoft.com

I am sure this is not what you are looking for; but still this may help..

If you dont want to zoom the spreadsheet then the other option would be to
select a cell in Row 1 towards the middle of the screen (say G1 or H1) and
Window
If this post helps click Yes
---------------
Jacob Skaria

> Thanks.

On Fri, 5 Jun 2009 02:05:01 -0700, Trevor Williams <...@discussions.microsoft.com

Hi dgold82 --
Try this. It could probably be 'streamlined' but will do the job you're
looking for.
HTH

Trevor Williams

-------------------

Sub CentreScreen()
Dim ImageSizeRow As Single
Dim ImageSizeCol As Single
x = Array(1, 7)
ImageSizeCol = Range("B:F").Columns.Width
ColWidths = (ActiveWindow.UsableWidth - ImageSizeCol) / 2
On Error GoTo CleanUp
With Range("A1", "G1")
Factor = .Columns(1).Width / .Columns(1).ColumnWidth
For i = 0 To 1
.Columns(x(i)).ColumnWidth = ColWidths / Factor
Next
End With
CleanUp:
End Sub

> Thanks.

On Fri, 5 Jun 2009 08:49:01 -0700, dgold82 <...@discussions.microsoft.com

Thanks, Trevor. This is where I am going! My range is actually rows A:K with
varying widths in each column.

Your code expanded the A column and actually pushed some of the colums out
of the window. Is there a way to center the columns in my window without
actually changing their widths. Only A through K will be visible the rest
will be hidden.

Thanks!

> > Thanks.