+ Reply to Thread
Results 1 to 4 of 4

data validation

Hybrid View

  1. #1
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: data validation

    Worksheet event is used.
    Sheet 'Data entry' A2:A10 is validated.
    Validation list 'list' F1:F10
    Worksheet event code for 'Data entry' sheet.
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("A2:A10")) Is Nothing Then
    If Target = "" Then
    Exit Sub
    Else
    Application.EnableEvents = False
    Target.Value = Left(Target.Value, InStr(1, Target.Value, "-") - 1)
    Application.EnableEvents = True
    End If
    End If
    End Sub
    How to use workheet 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 Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 12-26-2023, 11:38 AM
  2. [SOLVED] Auto-populating formula's and Data Validation based on 1 cells data validation result
    By Newtonus_Prime in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-19-2023, 10:21 AM
  3. [SOLVED] VBA to Prevent Data Entry in Cell with Data Validation List - Two Criteria Validation
    By AliGW in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 05-25-2019, 11:48 AM
  4. Replies: 1
    Last Post: 01-14-2018, 11:04 AM
  5. Multi-select from data validation isn't working with auto-assigning data validation
    By iPenguin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-11-2017, 12:37 PM
  6. [SOLVED] Data Validation: How to clear/delete the content of the cell and not Data Validation List?
    By lukelucky in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-07-2015, 09:42 AM
  7. Using Defined Names with Data Validation Depend and Data Validation Multi Select
    By Vinnie Chan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-01-2012, 05:36 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1