Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-12-2024, 07:03 AM
Karen615 Karen615 is offline Drop-down Box Windows 11 Drop-down Box Office 2021
Competent Performer
Drop-down Box
 
Join Date: Jun 2011
Location: Chicago
Posts: 145
Karen615 is on a distinguished road
Default Drop-down Box

Hello,



Is there a way to create a drop-down list that does the following:

When the user opens the drop-down, you see (for example) AK-Alaska, AL-Alabama, AR-Arkansas, etc. But when the cell is populated, it only returns the two-character state.

Your health is greatly appreciated.
TIA, Karen
Reply With Quote
  #2  
Old 09-16-2024, 03:48 PM
Alansidman's Avatar
Alansidman Alansidman is offline Drop-down Box Windows 11 Drop-down Box Office 2021
עַם יִשְׂרָאֵל חַי
 
Join Date: Apr 2019
Location: Steamboat Springs
Posts: 112
Alansidman has a spectacular aura aboutAlansidman has a spectacular aura aboutAlansidman has a spectacular aura about
Default

I am pretty sure that for this to work, you will need to have a combo box linked to some VBA that would include the workbook function =Left
__________________
Alan עַם יִשְׂרָאֵל חַ Using O365 v2505
Reply With Quote
  #3  
Old 09-26-2024, 06:10 PM
Karen615 Karen615 is offline Drop-down Box Windows 11 Drop-down Box Office 2021
Competent Performer
Drop-down Box
 
Join Date: Jun 2011
Location: Chicago
Posts: 145
Karen615 is on a distinguished road
Default

Thank you so much for your suggestion.

Best,
Karen
Reply With Quote
  #4  
Old 10-31-2024, 06:53 AM
kvsrinivasamurthy kvsrinivasamurthy is offline Drop-down Box Windows XP Drop-down Box Office 2007
Novice
 
Join Date: Oct 2017
Posts: 12
kvsrinivasamurthy is on a distinguished road
Default

Worksheet event is used.
Let the validation range is C2:C6.
Select the range C2:C6. select Data Validation in ribbon.
In the Data Validation dialogue box select Error Alert. In Style dropdown select Information. Ok.
Event code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C2:C6")) Is Nothing Then
Application.EnableEvents = False
Target = Left(Target, 2)
Application.EnableEvents = True
End If
End Sub
How to use worksheet event the code
Right click on Sheet tab --> view code
Visual Basic (VB) window opens.
Paste the code
Close the VB window.
Save the file as .xlsm
Attached Files
File Type: xlsm Special Data Validation..xlsm (16.6 KB, 6 views)
Reply With Quote
  #5  
Old 11-05-2024, 09:10 AM
SnakeDoctor's Avatar
SnakeDoctor SnakeDoctor is offline Drop-down Box Windows 11 Drop-down Box Office 2021
Advanced Beginner
 
Join Date: Jul 2023
Location: Ft. Worth, TX
Posts: 38
SnakeDoctor is on a distinguished road
Default Is there a way to do this in the same data validation cells?

I would like to be able to make a selection in the drop down, and have it populate the selections abbreviation in the same cell...

https://www.msofficeforums.com/attac...1&d=1730822992

Is this possible?
Reply With Quote
  #6  
Old 11-06-2024, 01:38 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Drop-down Box Windows 10 Drop-down Box Office 2021
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

Please start a new thread. There was nothing attached either
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop-down Box Cascading drop-downs in Word with one parent menu and four dependent drop-downs mrstrawhand Word VBA 3 03-30-2020 06:08 AM
Activate (show) a Drop-down form field when another drop-down form field is selected from Jentis Word VBA 1 04-19-2018 09:42 PM
Drop down box list based on response to another drop down box Phideaux Excel 16 04-13-2018 03:07 AM
Drop-down Box Drop down lists and pulling data from worksheet based on drop down selection cjoyce73 Excel 5 07-17-2017 07:40 AM
Help, auto select drop down by another drop down value? skrallemand Word VBA 3 09-11-2013 11:55 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft