Archive of Mr Excel Message Board


Back to Controls in Excel archive index
Back to archive home

Input box

Posted by lucky on December 20, 2001 1:49 AM
Hi I wish to know how to use an input box so that the data entered by the user is transferred to a cell on a sheet. ie.
Sub auto_open()
x = InputBox("which scheme?", "deposit calc", vbOKCancel)
End Sub

So when the scheme number is entered it transfers to a cell, so it cutomises that sheet.
And can I use more than one input box as the file opens to gather more data?
Thanks in anticipation.


Re: Input box

Posted by Hermia on December 20, 2001 4:04 AM


Sub auto_open()
x = InputBox("which scheme?", "deposit calc", vbOKCancel)
Sheets("Sheet1").Range("A1") = x
End Sub



Thanks Hermia, now my auto_open doesnt seem to work

Posted by lucky on December 20, 2001 4:45 AM
I cant get the input box to appear when I open the file???
This is what I have got now......

Sub Auto_open()
x = InputBox("which scheme?", "deposit calc", vbOKCancel)
Sheets("sheet1").Range("b2") = x
End Sub

Thanks again!



Re: Thanks Hermia, now my auto_open doesnt seem to work

Posted by Hermia on December 20, 2001 6:04 AM
Works for me.
Have you got the macro in the correct module? It should be in a normal code module. I cant get the input box to appear when I open the file???



dont worry sorted it, thanks again!

Posted by lucky on December 20, 2001 6:22 AM



This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.