Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Where do I set vbYesNo in a Inputbox? What I am trying to
accomplish is if the user clicks Cancel then it stops the macro. Is it just as simple as putting Cancel as Boolean within the ()? Sub Paste_Macro() On Error GoTo ErrorHandler Dim StrDate As String Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False ActiveCell.Offset(0, -1).Range("A1").Select Application.CutCopyMode = False StrDate = InputBox("What is the date?", "Date Needed") If StrDate = vbCancel Then Exit Sub ActiveCell.FormulaR1C1 = StrDate ActiveCell.Offset(0, 1).Select ActiveCell.Offset(1, 1).Select ActiveWorkbook.Save Exit Sub ErrorHandler: MsgBox Err.Number & " " & Err.Description End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
InputBox Help | Excel Discussion (Misc queries) | |||
InputBox with VBA | Excel Discussion (Misc queries) | |||
InputBox | Excel Discussion (Misc queries) | |||
inputbox | Excel Discussion (Misc queries) | |||
Inputbox with VBA | Excel Discussion (Misc queries) |