A collection of fun web links
Only "Useless" if you always maximise your windows
Published on February 13, 2004 By webfun In Software Development
However if you use MDI windows then add this code to your PERSONAL.XLS

Run "CreateButtons" ONCE only and you'll get two extra buttons that let you Tile or Cascade your spreadsheets.


Attribute VB_Name = "MyCascades"
'
' MyCascades
'

Option Explicit


Sub MyCascade()
'
Windows.Arrange ArrangeStyle:=xlCascade

End Sub

Sub MyTile()
'
Windows.Arrange ArrangeStyle:=xlArrangeStyleTiled

End Sub


Sub CreateButtons()
'
Const vbFaceIdHappy As Long = 59 ' happy
Const vbFaceIdA As Long = 80 ' A
Const vbFaceIdB As Long = 81 ' B
Const vbFaceIdClock As Long = 126 ' clock
Const vbFaceIdFox As Long = 266 ' fox
Const vbFaceIdSad As Long = 276 ' sad
Const vbFaceIdTile As Long = 298 ' tile
Const vbFaceIdDots As Long = 485 ' dots
Const vbFaceIdCascade As Long = 585 ' cascade

CreateButton "Tile", "Tile by CD", "MyTile", vbFaceIdTile
CreateButton "Cascade", "Cascade by CD", "MyCascade", vbFaceIdCascade

End Sub

Sub CreateButton( _
IconCapt As String _
, IconDesc As String _
, IconAction As String _
, IconFace As Long _
)
'
Dim myControl As CommandBarButton

Set myControl =
Application.CommandBars("Standard").Controls.Add(Type:=msoControlButton)

With myControl
.Caption = IconCapt
.DescriptionText = IconDesc
.OnAction = IconAction
.FaceId = IconFace
.Style = msoButtonIconAndCaption
End With

Set myControl = Nothing

End Sub





Comments
No one has commented on this article. Be the first!