Data validationin logical function
Closed
vachee1
Posts
1
Registration date
Tuesday 27 September 2011
Status
Member
Last seen
27 September 2011
-
27 Sep 2011 à 15:54
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 27 Sep 2011 à 21:46
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 27 Sep 2011 à 21:46
Related:
- When you wrote incorrect functions, what did you learn about spreadsheet data?
- Spreadsheet functions - Guide
- Tmobile data check - Guide
- What is the function of a hard drive - Guide
- We weren't able to confirm your identity from the video you submitted. you can submit a new video and we'll review it again. learn more - Instagram Forum
- How to copy data from one excel sheet to another - Guide
1 response
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
27 Sep 2011 à 21:46
27 Sep 2011 à 21:46
try this macro
Sub test()
Dim re As Range, rf As Range
Set re = Range("E1:E5")
Set rf = Range("F1:F5")
If Range("C1") = Range("B1") Then
With Range("D1").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=$E$1:$E$5"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
Else
With Range("D1").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=$F$1:$F$5"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End If
End Sub