Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function ApproveRejectButton() As Long
- Const SheetID As String = "_Buttonz"
- Dim btnDlg As DialogSheet
- Application.ScreenUpdating = False
- On Error Resume Next
- Application.DisplayAlerts = False
- ActiveWorkbook.DialogSheets(SheetID).Delete
- Application.DisplayAlerts = True
- Err.Clear
- Set btnDlg = ActiveWorkbook.DialogSheets.Add
- With btnDlg
- .Name = SheetID
- .Visible = xlSheetHidden
- With .DialogFrame
- .Height = 55
- .Width = 265
- .Caption = "Approve Or Reject Spreadsheet"
- End With
- With .Buttons("Button 2")
- .BringToFront
- .Left = 190
- .Top = 42
- .Height = 25
- .Width = 60
- .Caption = "Approve"
- End With
- With .Buttons("Button 3")
- .BringToFront
- .Left = 260
- .Top = 42
- .Height = 25
- .Width = 60
- .Caption = "Reject"
- End With
- .Labels.Add 80, 40, 100, 60
- .Labels(1).Caption = "Do you want to approve or reject this spreadsheet?"
- Application.ScreenUpdating = True
- If .Show = True Then
- ApproveRejectButton = 1
- Else
- ApproveRejectButton = 0
- End If
- Application.DisplayAlerts = False
- .Delete
- Application.DisplayAlerts = True
- End With
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement