InputBox Macro

amattey

New Member
Joined
Jul 18, 2011
Messages
46
Hi,

One of my subroutines filters the data in another sheet according to one parameter (always fixed). I want the user to input this parameter in an input box but limiting the parameter to only 5 types of entries, if the input left in blank, or hit cancel, or input is different than the only 5 parameters i want to show "Invalid Input". after this input box gets the input I want that value to go on my other formula. I have done part of the code but stuck on linking the input with the error messahe and my other subroutine. Could anyone give me an example here?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi,

One of my subroutines filters the data in another sheet according to one parameter (always fixed). I want the user to input this parameter in an input box but limiting the parameter to only 5 types of entries, if the input left in blank, or hit cancel, or input is different than the only 5 parameters i want to show "Invalid Input". after this input box gets the input I want that value to go on my other formula. I have done part of the code but stuck on linking the input with the error messahe and my other subroutine. Could anyone give me an example here?


to see if blank or has hit cancel (same as putting blank)

Code:
    dim asd as string
    asd = InputBox("Enter Information")
    If asd = "" Then
    'what happens when blank or cancel
    Else
   'what happens when has data
end if

To call your other routine simply

Call rountinename
 
Upvote 0

Forum statistics

Threads
1,224,509
Messages
6,179,192
Members
452,893
Latest member
denay

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