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 multiple validations

I have an excel file that has validation set up to choose numbers from a
list. In the column next to the numbers, I have a description of what the
numbers represent. Is there anyway to be view both columns in my drop down
list, but only insert the numbers? I thought maybe I could just merge the
two columns together and limit the number of characters that were actually
inserted into the cell, but I couldn't figure out how to do that. Any help
would be appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default multiple validations

Koby,

Make up your list of validation values like

1 Description
2 Other stuff
3 blah blah
.....

So that the number is the left part, and the description is the right part of the string, separated
by a space.

Then copy this code, right-click the sheet tab, select "View Code" and paste the code into the
window that appears. Change the H5:H10 to the address of the range that you want to have this work
on.

Then, when the call value is changed, only the number to the left will appear in the cell.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("H5:H10")) Is Nothing Then Exit Sub
If Target.Value = "" Then Exit Sub
Application.EnableEvents = False
On Error Resume Next
Target.Value = Left(Target.Value, InStr(1, Target.Value, " ") - 1)
Application.EnableEvents = True

End Sub

HTH,
Bernie
MS Excel MVP


"Koby W." <Koby wrote in message
...
I have an excel file that has validation set up to choose numbers from a
list. In the column next to the numbers, I have a description of what the
numbers represent. Is there anyway to be view both columns in my drop down
list, but only insert the numbers? I thought maybe I could just merge the
two columns together and limit the number of characters that were actually
inserted into the cell, but I couldn't figure out how to do that. Any help
would be appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default multiple validations

There is a sample file here that demonstrates this:

http://contextures.com/excelfiles.html#DataVal

Look for: DV0004 - Data Validation Change

--
Biff
Microsoft Excel MVP


"Koby W." <Koby wrote in message
...
I have an excel file that has validation set up to choose numbers from a
list. In the column next to the numbers, I have a description of what the
numbers represent. Is there anyway to be view both columns in my drop
down
list, but only insert the numbers? I thought maybe I could just merge the
two columns together and limit the number of characters that were actually
inserted into the cell, but I couldn't figure out how to do that. Any
help
would be appreciated.



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
selecting validations Monkey-See, Monkey-Do[_2_] Excel Discussion (Misc queries) 1 June 27th 08 01:11 PM
Data Validations Christopher Naveen[_2_] Excel Worksheet Functions 1 May 13th 08 08:55 AM
2 Data Validations Q Sean Excel Worksheet Functions 7 October 31st 07 11:56 AM
Multiple Data Validations Supe Excel Discussion (Misc queries) 1 August 9th 07 04:39 PM
Multiple Validations in for 1 cell dmcnutt_ghg Excel Worksheet Functions 1 November 23rd 05 08:09 PM


All times are GMT +1. The time now is 07:07 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"