Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

No cancel on input

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Luis A. Vázquez - 18 Sep 2007 16:19 GMT
How can i make an inputbox...popup, that does not have a cancel
button?

Is this possible? This is the code i have that i would like to
elimitate the cancel button.

Sub Auto_Open()
name = Range("A2")
A2 = name
If A2 = "" Then
A2 = InputBox("Entra tu Nombre ", "Nombre .")
Else

End If
Worksheets("Sheet1").Range("A2").Activate
   ActiveCell = A2
End Sub
Jim Thomlinson - 18 Sep 2007 16:52 GMT
Input boxes always have cancel buttons. What you want to do is to catch when
the user has selected Cancel. take a look at the value returned by the input
box when cancel was selected and create some code to deal with it.
Signature

HTH...

Jim Thomlinson

> How can i make an inputbox...popup, that does not have a cancel
> button?
[quoted text clipped - 13 lines]
>     ActiveCell = A2
> End Sub
JW - 18 Sep 2007 16:54 GMT
As far as I know, you can't totally get rid of the Cancel button.  You
could always create a userform that resembles an Inputbox and do it
that way.  Or, you can force them to enter a value in the input box
with something like this (untested):
Sub Auto_Open()
   A2 = Range("A2")
   If A2 = "" Then
start:
       A2 = InputBox("Entra tu Nombre ", "Nombre .")
       If A2 = "" Then
           MsgBox "You MUST enter a value!", , "Required"
           GoTo start
       End If
   End If
   Worksheets("Sheet1").Range("A2").Value = A2
End Sub

You'll also notice that I cleaned your code up a bit.  No need to have
a variable to store another variable.  And no need to activate the
cell before placing the value in it.
Luis A. V?zquez wrote:
> How can i make an inputbox...popup, that does not have a cancel
> button?
[quoted text clipped - 13 lines]
>     ActiveCell = A2
> End Sub
Luis A. Vázquez - 18 Sep 2007 18:12 GMT
> As far as I know, you can't totally get rid of the Cancel button.  You
> could always create a userform that resembles an Inputbox and do it
[quoted text clipped - 35 lines]
> >     ActiveCell = A2
> > End Sub

JW,

Works very well. And thanks for the tip on cleaning up.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.