Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Using a IF function in a validation list cell

I want to have an item on a validation cell automatically selected when an
item in another cell's list is selected. I kind of feel like it would be
something like:
=IF(COUNTIF(D9,"*Base*"),24, UNKNOWN COMMAND ). This would look for the word
"Base" in the cell D9 and if true would select 24 from the list, and if false
I want it to defer to the user's selection.

Not even sure this can be done.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Using a IF function in a validation list cell

-You can name the validation list range to say 'myRange' and enter 24 to
another cell and name it 'myRange1'. Use the below formula for validation
list criteria

=IF(COUNTIF(D9,"*Base*"),MYRANGE1,myrange)

--OR using VBA..

Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the
right blank portion. Get back to to workbook and try out.


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$9" Then
Application.EnableEvents = False
If InStr(1, Target, "base", vbTextCompare) Then Range("E9") = 24
Application.EnableEvents = True
End If
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Hackipotimus" wrote:

I want to have an item on a validation cell automatically selected when an
item in another cell's list is selected. I kind of feel like it would be
something like:
=IF(COUNTIF(D9,"*Base*"),24, UNKNOWN COMMAND ). This would look for the word
"Base" in the cell D9 and if true would select 24 from the list, and if false
I want it to defer to the user's selection.

Not even sure this can be done.

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
Using IF function and validation/list jp_az[_2_] Excel Worksheet Functions 0 November 24th 08 07:01 PM
Using If Function with a Data Validation List BillyT Excel Discussion (Misc queries) 1 July 1st 08 11:28 PM
IF Function/Validation List/Totals Phendrena Excel Worksheet Functions 1 September 1st 07 05:12 PM
List Validation and IF Function Problem mmd206 Excel Worksheet Functions 2 August 2nd 07 11:12 PM
Using IF function and validation list Shavey Excel Worksheet Functions 4 July 4th 06 11:19 AM


All times are GMT +1. The time now is 04:56 PM.

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

About Us

"It's about Microsoft Excel"