Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Data Validation & Messages

  1. #11
    Acolyte Roger Govier's Avatar
    Join Date
    Mar 2011
    Location
    Located near Abergavenny, South Wales, UK
    Posts
    79
    Articles
    0


    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi

    Works fine for me.
    Are you sure that what you are testing for in code is EXACTLY the same as the entry you have in your cell in the workbook?

    Can you upload a copy of the workbook for us to have a look at?
    Regards

    Roger Govier
    Microsoft Excel MVP
    http://www.technology4u.co.uk

  2. #12
    Good morning
    Please select “SAT Converted to SAR” and 1 to be the number of heads. You will see the message box; click OK, then highlight both of them (the # of heads and the option” and click delete. You will receive the error # 13. I appreciate your support. Thank you.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Deleate.jpg 
Views:	1 
Size:	91.6 KB 
ID:	86  
    Attached Files Attached Files

  3. #13
    Acolyte Roger Govier's Avatar
    Join Date
    Mar 2011
    Location
    Located near Abergavenny, South Wales, UK
    Posts
    79
    Articles
    0


    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi

    I see the problem.
    When hastily posting a quick example, I hadn't included the test to ensure you didn't have more than 1 cell selected.

    If Target.Count > 1 Then Exit Sub

    The amended code is
    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim myrange As Range
    
        Set myrange = Range("B7:B14")
        If Target.Count > 1 Then Exit Sub
        If Not Intersect(Target, myrange) Is Nothing Then
            If Target.Value = "SAT Converted to SAR" Then
                Call MsgBox("You have selected SAT Converted to SAR", vbExclamation, "Warning")
            End If
            
        End If
    
    End Sub
    Regards

    Roger Govier
    Microsoft Excel MVP
    http://www.technology4u.co.uk

Page 2 of 2 FirstFirst 12

Posting Permissions

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