Simple VBA messagebox query

jamesfbeard123

New Member
Joined
Sep 30, 2016
Messages
11
Hi all,

Please can you help with a simple messagebox query.

I need some vba which will basically pop up a user box if someone enters speicifc text into a specfic cell.

e.g. if a user enters "Closed" into cell A1 a messagebox will pop up saying complete but if the user populates "Open" into cell A1 the message box does not appear.

Thanks,

James
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi,

This will work for all cells in column A... if you want it to work only for a specific cell or a specific range of rows then it should get you started

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

' target changes only in Column A
If Target.Column = 1 Then

If Target.Value = "Closed" Then

MsgBox "Complete"

End If

End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,377
Members
448,955
Latest member
BatCoder

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