Do not allow blank or null if Adjacent Cell Contains Specific Text in Excel using VBA code

anbaz

New Member
Joined
Dec 15, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I’m working on to build a simple data entry form for my users where I need to validate one scenario

Please see the same data.
Field Name
DataType
Dropdown values
Name
Text​
NA
DOB
Date​
NA
Offer Related
List Items​
1. Welcome Offer
2. Shopping Offer
3. Weekend Offer
4. Other
Card Number
Number​
NA
Statement
List Items​
1. Email
2. Physical Copy
3. SMS

If user selects Datatype = List Items then the user cannot leave the “dropdown values” cell with null value, I want to validate and prompt user using MsgBox alert. I want to achieve this validation using VBA code as I have other validation for the same cell range using data validation.

Can someone help?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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