![]() |
Data Validation
I want to do data validation such that if any data is entered in Cell A1 than
Cell A2 cannot be left blank. is it possible |
Data Validation
Dear Vijaya
From menu Data|Validation| Select the validation criteria|Custom Enter formula Uncheck 'Ignore Blank' If this post helps click Yes --------------- Jacob Skaria "Vijaya" wrote: I want to do data validation such that if any data is entered in Cell A1 than Cell A2 cannot be left blank. is it possible |
Data Validation
Oops..If your data cannot be defined you can use the below code to validate
this before Save. If you are new to macros set the Security level to low/medium in (Tools|Macro|Security). 'Launch VBE using short-key Alt+F11. On the left treeview double click 'This Workbook '. Drop down and select BeforeSave event. Paste this code. Save. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If Trim(Worksheets("Sheet1").Range("A1")) < "" Then If Trim(Worksheets("Sheet1").Range("A2")) = "" Then Worksheets("Sheet1").Range("A2").Activate MsgBox "This cell cannot be blank" Cancel = True End If End If End Sub -- If this post helps click Yes --------------- Jacob Skaria "Vijaya" wrote: I want to do data validation such that if any data is entered in Cell A1 than Cell A2 cannot be left blank. is it possible |
All times are GMT +1. The time now is 01:55 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com