Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can I write an "InputBox" statement to end the sub if the Cancel button is
clicked? This is the line that I have. InputBox "Enter Next Invoice Month", "Creat Invoice.", Range("M16").Value Thanks, Paul |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Public Sub test()
If InputBox("Enter Next Invoice Month", "Creat Invoice.", Range("M16").Value) = "" Then Exit Sub Else 'do some stuff here End If End Sub -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "PCLIVE" wrote: | Can I write an "InputBox" statement to end the sub if the Cancel button is | clicked? This is the line that I have. | | InputBox "Enter Next Invoice Month", "Creat Invoice.", Range("M16").Value | | | Thanks, | Paul | | |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the response.
This kind of works, but I still need to somehow use the input box entry in the "Else" code. For example, I'd like to make Range("O1").value to be the inputbox entry. Thanks again. "Dave Patrick" wrote in message ... Public Sub test() If InputBox("Enter Next Invoice Month", "Creat Invoice.", Range("M16").Value) = "" Then Exit Sub Else 'do some stuff here End If End Sub -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "PCLIVE" wrote: | Can I write an "InputBox" statement to end the sub if the Cancel button is | clicked? This is the line that I have. | | InputBox "Enter Next Invoice Month", "Creat Invoice.", Range("M16").Value | | | Thanks, | Paul | | |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok, but that's a different question. What rules or criteria is going to make
the Input box default change? -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "PCLIVE" wrote: | Thanks for the response. | | This kind of works, but I still need to somehow use the input box entry in | the "Else" code. For example, I'd like to make Range("O1").value to be the | inputbox entry. | | Thanks again. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Option Explicit
Public Sub test() Dim Resp As String Resp = InputBox("Enter Next Invoice Month", "Creat Invoice.", _ Range("M16").Value) If Resp = "" Then Exit Sub Else Range("o1").Value = Resp End If End Sub PCLIVE wrote: Thanks for the response. This kind of works, but I still need to somehow use the input box entry in the "Else" code. For example, I'd like to make Range("O1").value to be the inputbox entry. Thanks again. "Dave Patrick" wrote in message ... Public Sub test() If InputBox("Enter Next Invoice Month", "Creat Invoice.", Range("M16").Value) = "" Then Exit Sub Else 'do some stuff here End If End Sub -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "PCLIVE" wrote: | Can I write an "InputBox" statement to end the sub if the Cancel button is | clicked? This is the line that I have. | | InputBox "Enter Next Invoice Month", "Creat Invoice.", Range("M16").Value | | | Thanks, | Paul | | -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dave,
This does what I need. Your help is much appreciated. Thank you, Paul "Dave Peterson" wrote in message ... Option Explicit Public Sub test() Dim Resp As String Resp = InputBox("Enter Next Invoice Month", "Creat Invoice.", _ Range("M16").Value) If Resp = "" Then Exit Sub Else Range("o1").Value = Resp End If End Sub PCLIVE wrote: Thanks for the response. This kind of works, but I still need to somehow use the input box entry in the "Else" code. For example, I'd like to make Range("O1").value to be the inputbox entry. Thanks again. "Dave Patrick" wrote in message ... Public Sub test() If InputBox("Enter Next Invoice Month", "Creat Invoice.", Range("M16").Value) = "" Then Exit Sub Else 'do some stuff here End If End Sub -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "PCLIVE" wrote: | Can I write an "InputBox" statement to end the sub if the Cancel button is | clicked? This is the line that I have. | | InputBox "Enter Next Invoice Month", "Creat Invoice.", Range("M16").Value | | | Thanks, | Paul | | -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Workbook_BeforeClose(Cancel As Boolean) - Cancel won't work | Setting up and Configuration of Excel | |||
Input Box Cancel | Excel Discussion (Misc queries) | |||
Disabling 'Cancel' option when saving work (Yes/No/Cancel) | Excel Programming | |||
Cancel Macro is user selects 'cancel' at save menu | Excel Programming | |||
How do I check if a user clicked the Print Cancel button | Excel Programming |