The Code below works perfectly except it will not move anything to the second tab that is beyond column M.. Can someone please help me fix it so that it cuts and pastes onto the second tab all the way to column S?
Sub Auto_Open()
Dim oToolbar As CommandBar
Dim oButton As CommandBarButton
Dim MyToolbar As String
Dim oPic As stdole.IPictureDisp
Dim oMask As stdole.IPictureDisp
' Give the toolbar a name
MyToolbar = "IPG Toolbar"
On Error Resume Next
' so that it doesn't stop on the next line if the toolbar's already there
' Create the toolbar; PowerPoint will error if it already exists
Set oToolbar = CommandBars.Add(Name:=MyToolbar, Position:=msoBarTop, Temporary:=True)
oToolbar.Protection = msoBarNoCustomize
If Err.Number <> 0 Then
' The toolbar's already there, so we have nothing to do
Exit Sub
End If
On Error GoTo ErrorHandler
' Now add a button to the new toolbar
Set oButton = oToolbar.Controls.Add(Type:=msoControlButton)
' And set some of the button's properties
With oButton
.FaceId = 6853
.TooltipText = "IPG Non-Confidential"
.Caption = "IPG &Non-Confidential"
.OnAction = "Non"
.Style = msoButtonIconAndCaption
End With
' Now add a button to the new toolbar
Set oButton = oToolbar.Controls.Add(Type:=msoControlButton)
' And set some of the button's properties
With oButton
.FaceId = 6852
.TooltipText = "IPG Green"
.Caption = "IPG &Green"
.OnAction = "Green"
.Style = msoButtonIconAndCaption
End With
' Now add a button to the new toolbar
Set oButton = oToolbar.Controls.Add(Type:=msoControlButton)
' And set some of the button's properties
With oButton
.FaceId = 6859
.TooltipText = "IPG Yellow"
.Caption = "IPG &Yellow"
.OnAction = "Yellow"
.Style = msoButtonIconAndCaption
End With
' Now add a button to the new toolbar
Set oButton = oToolbar.Controls.Add(Type:=msoControlButton)
' And set some of the button's properties
With oButton
.FaceId = 6850
.TooltipText = "IPG Red"
.Caption = "IPG &Red"
.OnAction = "Red"
.Style = msoButtonIconAndCaption
End With
oToolbar.Visible = True
NormalExit:
Exit Sub ' so it doesn't go on to run the errorhandler code
ErrorHandler:
'Just in case there is an error
MsgBox Err.Number & vbCrLf & Err.Description
Resume NormalExit:
End Sub
Sub Non()
IPG "Non-Confidential"
End Sub
Sub Green()
IPG "Confidential Green"
End Sub
Sub Yellow()
IPG "Confidential Yellow"
End Sub
Sub Red()
IPG "Confidential Red"
End Sub
Sub IPG(classification)
On Error Resume Next
ActiveSheet.PageSetup.LeftFooter = "Caterpillar: " & classification
End Sub![]()
Please Login or Register to view this content.
Bookmarks