Input boxes

joacro

Board Regular
Joined
Jun 24, 2010
Messages
158
Hi there,

Hope someone can help with my query.

I need an input box to pop up.

Ex: If Range ("B2").value = X(!) THEN
input box should pop up "Please insert amount"
The amount entered should than go into Range ("C2")

Thx in advance
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Try this: right click the sheet tab, select View Code and paste in

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x As Variant
If Target.Address(False, False) = "B2" And Target.Value = "X(!)" Then
    x = Application.InputBox("Enter amount", Type:=1)
    If TypeName(x) = "Boolean" Then Exit Sub
    Application.EnableEvents = False
    Range("C2").Value = x
    Application.EnableEvents = True
End If
End Sub
 
Upvote 0
That specific sheet: right click its tab, select View Code and paste in the code.
 
Upvote 0
VoG,

It works perfectly

Thank you.

What should i do if there is more cells with that criteria?
 
Upvote 0
Where are the other cells? In column B and you want to add values to the corresponding cell in column C?
 
Upvote 0

Forum statistics

Threads
1,214,605
Messages
6,120,473
Members
448,967
Latest member
visheshkotha

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