Application.Caption Centering

jstevens
GoldLounger
Posts: 2629
Joined: 26 Jan 2010, 16:31
Location: Southern California

Application.Caption Centering

Post by jstevens »

Is it possible to center the caption? The default is left aligned.

Regards,
John
Regards,
John

User avatar
Jezza
5StarLounger
Posts: 847
Joined: 24 Jan 2010, 06:35
Location: A Magic Forest in Deepest, Darkest, Kent

Re: Application.Caption Centering

Post by Jezza »

Hi John

It all depends on screen size and resolution so I have played around a little and got this which is near as damn it.

Code: Select all

Private Sub CentreCaption()
     Application.Caption = String(Int(ActiveWindow.Width / 5), Chr(32)) & "John's Workbook"
     ActiveWindow.Caption = "is in the centre"
End Sub
Jerry
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it