Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default No cancel on input

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default No cancel on input

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.
--
HTH...

Jim Thomlinson


"Luis A. Vázquez" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default No cancel on input

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?

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default No cancel on input

On Sep 18, 11:54 am, JW wrote:
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?


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


JW,

Works very well. And thanks for the tip on cleaning up.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Input Box Cancel Jase Excel Discussion (Misc queries) 2 September 15th 08 11:42 PM
Input Box - CANCEL Danny Excel Worksheet Functions 6 December 1st 06 02:15 AM
Input box to cancel sub when Cancel is clicked. PCLIVE Excel Programming 5 September 5th 06 03:19 PM
Input box cancel Little Penny Excel Programming 1 August 25th 06 11:50 PM
cancel input ME @ Home Excel Discussion (Misc queries) 1 February 22nd 06 09:49 AM


All times are GMT +1. The time now is 09:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"