Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
custom data validation on cells with data validation values | Excel Worksheet Functions | |||
data validation invalid in dynamic validation list | Excel Discussion (Misc queries) | |||
data validation invalid in dynamic validation list | Excel Worksheet Functions | |||
data validation invalid in dynamic validation list | Excel Programming | |||
Data validation with validation lists and combo boxs | Excel Discussion (Misc queries) |