InputBox Title and text

jb3700

New Member
Joined
Jun 8, 2015
Messages
8
does anyone know how a can change to title of an InputBox and have the text that the user puts into the InputBox appear in a cell ?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
does anyone know how a can change to title of an InputBox and have the text that the user puts into the InputBox appear in a cell ?
The first part of your question is not entirely clear... are you asking how to put your own title on an InputBox to replace the default of "Microsoft Excel" for a VBA InputBox or "Input" for an Application.InputBox? If so, there is a second argument where you can put a text string value (a variable containing a text string can be used there as well)...

InputBox "Hello", "Your title goes here"

Application.InputBox "Hello", "Your title goes here"

If you look at the Help File for either of these, you will see all of the arguments for them. A quick way to do that is to put the text cursor on the word InputBox in a line of code using it and then press the F1 key.
 
Upvote 0
Try to adopt the following code...

Code:
[color=darkblue]Option[/color] [color=darkblue]Explicit[/color]

[color=darkblue]Sub[/color] test()

    [color=darkblue]Dim[/color] sResp [color=darkblue]As[/color] [color=darkblue]String[/color]

    sResp = InputBox(Prompt:="Enter text...", Title:="Your Title")
    
    [color=darkblue]If[/color] Len(sResp) = 0 [color=darkblue]Then[/color]
        MsgBox "User cancelled", vbInformation
        [color=darkblue]Exit[/color] [color=darkblue]Sub[/color]
    [color=darkblue]End[/color] [color=darkblue]If[/color]
    
    Range("A2").Value = sResp
    
[color=darkblue]End[/color] [color=darkblue]Sub[/color]

Hope this helps!
 
Upvote 0
The first part of your question is not entirely clear... are you asking how to put your own title on an InputBox to replace the default of "Microsoft Excel" for a VBA InputBox or "Input" for an Application.InputBox? If so, there is a second argument where you can put a text string value (a variable containing a text string can be used there as well)...

InputBox "Hello", "Your title goes here"

Application.InputBox "Hello", "Your title goes here"

If you look at the Help File for either of these, you will see all of the arguments for them. A quick way to do that is to put the text cursor on the word InputBox in a line of code using it and then press the F1 key.
Sorry, I forgot to answer your second question, but I see Domenic has shown you how to do it at the end of the routine he posted.
 
Upvote 0

Forum statistics

Threads
1,216,084
Messages
6,128,722
Members
449,465
Latest member
TAKLAM

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top