If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Data validation depended on IF statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-01-09, 07:09
Starsky Starsky is offline
Registered User
 
Join Date: Apr 2009
Posts: 10
Data validation depended on IF statement

Hi folks,

I want to apply data validation (simple yes/no), but only if the adjacent cell = 'no'. If the adjacent cell = 'yes', 'n/a' will apply.

Is there a way to do this?

Many thanks.
Reply With Quote
  #2 (permalink)  
Old 06-01-09, 10:01
Ax238 Ax238 is offline
Registered User
 
Join Date: May 2009
Posts: 257
I haven't tried this, but the following tutorial looks promising:
Daily Dose of Excel » Blog Archive » Conditional Data Validation

Regards,

Ax
Reply With Quote
  #3 (permalink)  
Old 06-01-09, 10:06
Starsky Starsky is offline
Registered User
 
Join Date: Apr 2009
Posts: 10
Thanks. I'll check it out.
Reply With Quote
  #4 (permalink)  
Old 06-30-09, 08:30
OldKritter OldKritter is offline
Registered User
 
Join Date: Mar 2004
Location: Connecticut
Posts: 1
Data Validation conditioned on IF Statement

Create a macro.----If the data you want to match is in – say column Q1.
This code will change the matching cell to red, but you can use calcs or anything else based on the TRUE or FALSE return

Range("Q1").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-2]<>""whatever data you want to match"",RC[-1]="" whatever data you want to match "")"
Range("Q1").Select
Selection.Copy
Range("Q4:Q2000").Select
ActiveSheet.Paste


Range("Q:Q").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="TRUE"
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = True
.ColorIndex = 1
End With
With Selection.FormatConditions(1).Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.FormatConditions(1).Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Reply With Quote
  #5 (permalink)  
Old 06-30-09, 15:33
Starsky Starsky is offline
Registered User
 
Join Date: Apr 2009
Posts: 10
Many thanks OldKritter, that looks like it might work.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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