VBA Message box to show if user tries to enter info into a cell when another cell is empty

RJSIGKITS

Board Regular
Joined
Apr 15, 2013
Messages
109
Hi.

Could someone please help me with this, as I can't get it to work right.

I need to add a message box VBA to my worksheet which forces a user to enter other data before they can enter data into a specific cell, as follows:

User needs to add data on the worksheet, which fills Cell H1, in order to then be able to use the Data Validation dropdown selector in cell D14. If they have not entered the required data, an error message box is to show warning the user that they must add the required details before continuing.

Thanks
 

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.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$D$14" And [H1] = "" Then
    MsgBox "Enter data in H1"
    [H1].Select
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,208
Members
452,618
Latest member
Tam84

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