• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA visible columns aligned in the centre (full screen mode)

GioP

New Member
Good people over there. :)


Does anyone know if it is possible in full screen mode to align visible columns in the middle of the screen? (Rest of the columns are hidden). In other words like it works in “Word”, in full screen mode under “view options” if you select “Show one page” the page is aligned in the centre of the screen.

I’m using the following VBA code to open the workbook in full screen mode.


Any suggestions to modify this code to result alignment in the centre of the screen is appreciated


Private Sub Workbook_Open()


Sheets("sheet1").Select

Set myRange = ActiveSheet

Application.ScreenUpdating = False

Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"

Application.DisplayFormulaBar = False

Application.DisplayStatusBar = Not Application.DisplayStatusBar

ActiveWindow.DisplayWorkbookTabs = True


Dim wbBook As Workbook

Dim wsSheet As Worksheet


Set wbBook = ThisWorkbook


For Each wsSheet In wbBook.Worksheets

Rem If Not wsSheet.Name = "Blank" Then wsSheet.Activate

With ActiveWindow

.DisplayHeadings = False

.DisplayGridlines = False

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFormattingRows:=True

ActiveSheet.EnableSelection = xlUnlockedCells

End With

Next wsSheet


myRange.Select


End Sub


Private Sub Workbook_BeforeClose(Cancel As Boolean)

Set myRange = ActiveSheet

Application.ScreenUpdating = False

Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"

Application.DisplayFormulaBar = True

Application.DisplayStatusBar = True

ActiveWindow.DisplayWorkbookTabs = True


Dim wbBook As Workbook

Dim wsSheet As Worksheet


Set wbBook = ThisWorkbook


End Sub


Thanks in advance
 
GioP


I don't believe what you want to do is possible

Excel always keeps the columns to the left or to the right if using Right to Left

The only way would be to make the column to the left of your data the appropriate widthso that your data columns are centred

and then shade it the same color as the background, but I would question is that worth the effort
 
Thanks for clarification


So no 3D effect and only shade from side. I agree no point to shade column to imitate background effect.


P.S.

Let’s see if my next thread will have a solution. :)


Thanks again and regards
 
Back
Top