Consulting

Results 1 to 7 of 7

Thread: adding a message box icon

  1. #1
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location

    adding a message box icon

    Hi experts

    How would i add a message box icon to the following code....

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    If ActiveCell.Value = "" Then
    MsgBox ("Invalid Data Input Attempt - Error")
    End If

    End Sub

    need the user to see a STOP and red cross in a circle with the above message......once the message box is displayed and the user click ok to acknownledge the message......he/she still cannot go back and try to enter any data in all balnk/empty cells.....

    thanks

  2. #2
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    fixed the problem - the first part......but still cannot stop user from entering data into balank/empty cells.

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If ActiveCell.Value = "" Then
    MsgBox "Invalid Data Input Attempt - Error", vbCritical + vbOKOnly
    End If
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    XLD

    how do you do the second part ....... no data input at ALL - have no idea

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Protect the worksheet.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  6. #6
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    but i have loads of data entry point in the worksheet that are already protected i was look at the VBA option.....adding code to what i already have....

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    So change all cells to locked and add the protection.. And I do mean do it in VBA, far simpler than checking each cell in VBA.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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