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.

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


Posted by lucky on December 20, 2001 4:45 AM

Thanks Hermia, now my auto_open doesnt seem to work

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!


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

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

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???




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

dont worry sorted it, thanks again!