inputbox value not avaialble

Shadow123

Board Regular
Joined
Aug 20, 2012
Messages
124
Hi, appoligise for the double post... :/ can't find the other one...

Can anyone tell me why this doesn't work... its a brand new workbook, nothing else at all in it. The debug print returns the value of the input box just fine, but the message box is always blank

Code:
Public inputvalue As Long
Sub testing()
inputvalue = InputBox("Please enter value")
Debug.Print inputvalue
Call messageformat
End Sub

 Sub messageformat()
MsgBox (inputvaluve)
End Sub
</PRE>
 
Last edited:

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
sigh.... 24 hrs i have been stuck... that is just stupid. Sometimes i want to throw it out of the window lol.

Thanks very much, turns out that was the problem in the other book as well.
 
Upvote 0
In the VBE, Tools > Options, tick Require variable declaration. That will pick up that sort of issue.
 
Upvote 0
i turned that off about a week ago, got fed up with the message when i was testing stuff... now I remember why i turned it on lol.

Done.
 
Upvote 0

Forum statistics

Threads
1,196,321
Messages
6,014,632
Members
441,832
Latest member
tony tessman

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