Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom data validation on cells with data validation values AKrobbins Excel Worksheet Functions 2 June 21st 11 04:20 PM
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Programming 0 November 7th 06 12:54 PM
Data validation with validation lists and combo boxs Keith Excel Discussion (Misc queries) 1 October 12th 06 11:08 AM


All times are GMT +1. The time now is 11:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"