ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Format input box (https://www.excelbanter.com/excel-programming/418516-format-input-box.html)

Miree

Format input box
 
With the help of lovely forum peeps i have a piece of code which includes

Response = InputBox("Formulation Number", vbOKCancel)

Is it possible to format the inputbox, as its a little big and looks silly.

I have never used a user form so dont really have a clue where to start there

The Code Cage Team[_56_]

Format input box
 
An Inputbox isn't a UserForm its one of Excels built in boxes and as such we
cannot format it, if you were to create a userform to look like an InputBox
then you could size that as needed.

Regards,
The Code Cage Team
www.thecodecage.com/forumz

"Miree" wrote:

With the help of lovely forum peeps i have a piece of code which includes

Response = InputBox("Formulation Number", vbOKCancel)

Is it possible to format the inputbox, as its a little big and looks silly.

I have never used a user form so dont really have a clue where to start there


Miree

Format input box
 
If i do create a user form then how do i get it to use it instead of text box?


"The Code Cage Team" wrote:

An Inputbox isn't a UserForm its one of Excels built in boxes and as such we
cannot format it, if you were to create a userform to look like an InputBox
then you could size that as needed.

Regards,
The Code Cage Team
www.thecodecage.com/forumz

"Miree" wrote:

With the help of lovely forum peeps i have a piece of code which includes

Response = InputBox("Formulation Number", vbOKCancel)

Is it possible to format the inputbox, as its a little big and looks silly.

I have never used a user form so dont really have a clue where to start there


The Code Cage Team[_56_]

Format input box
 
Create a userform with a textbox and a commanbutton on it, then in the sub
that you have the Inputbox remove that and use the line: Userform1.Show, this
will show the userform, double click the command button on the userform in
design mode (when you can see the userform you are creating in the VBE) the
module for the button will pop up and read Private Sub Commanbutton1_Click(),
add this code, Activesheet.Range("A1").Value = Me.Textbox1.Value
Unload Me
those 2 lines of code do gthis: 1st) puts the value of the textbox on the
form in A1 of the sheet that is currently visible, 2nd) unloads the userform,
it's ok to unload it as we aren't using it again until the next call
otherwise we could use the line Userform1.Hide.

Hope this helps.

Regards,
The Code Cage Team
www.thecodecage.com/forumz


"Miree" wrote:

If i do create a user form then how do i get it to use it instead of text box?


"The Code Cage Team" wrote:

An Inputbox isn't a UserForm its one of Excels built in boxes and as such we
cannot format it, if you were to create a userform to look like an InputBox
then you could size that as needed.

Regards,
The Code Cage Team
www.thecodecage.com/forumz

"Miree" wrote:

With the help of lovely forum peeps i have a piece of code which includes

Response = InputBox("Formulation Number", vbOKCancel)

Is it possible to format the inputbox, as its a little big and looks silly.

I have never used a user form so dont really have a clue where to start there


John

Format input box
 
Have a look at this site - It shows you how to create a userform, add
controls like textboxes etc & even has a short video.
http://www.contextures.com/xlUserForm01.html
--
jb


"Miree" wrote:

If i do create a user form then how do i get it to use it instead of text box?


"The Code Cage Team" wrote:

An Inputbox isn't a UserForm its one of Excels built in boxes and as such we
cannot format it, if you were to create a userform to look like an InputBox
then you could size that as needed.

Regards,
The Code Cage Team
www.thecodecage.com/forumz

"Miree" wrote:

With the help of lovely forum peeps i have a piece of code which includes

Response = InputBox("Formulation Number", vbOKCancel)

Is it possible to format the inputbox, as its a little big and looks silly.

I have never used a user form so dont really have a clue where to start there



All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com