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
 
Yes it is also in column B and the corresponding Cell in collumn in C
Then also in D and E
And L and M and N and O
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Try

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x As Variant
Select Case Target.Column
    Case 2, 4, 12, 14
    If Target.Value = "X(!)" Then
        x = Application.InputBox("Enter amount", Type:=1)
        If TypeName(x) = "Boolean" Then Exit Sub
        Application.EnableEvents = False
        Target.Offset(, 1).Value = x
        Application.EnableEvents = True
    End If
End Select
End Sub
 
Upvote 0
Hi there VoG,

Sorry for the long delay. The above code works perfectly thank you. However I have a button on the spreadsheet that clears all data entered and starts of with a new blank sheet.
When I press this button it gives me a debug fault and takes me to
If Target.Value = "X(!)" Then
What should I do?
 
Upvote 0
Try

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x As Variant
If Target.Count > 1 Then Exit Sub
Select Case Target.Column
    Case 2, 4, 12, 14
    If Target.Value = "X(!)" Then
        x = Application.InputBox("Enter amount", Type:=1)
        If TypeName(x) = "Boolean" Then Exit Sub
        Application.EnableEvents = False
        Target.Offset(, 1).Value = x
        Application.EnableEvents = True
    End If
End Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,596
Messages
6,125,728
Members
449,255
Latest member
whatdoido

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