Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 



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 08:33 PM.


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