Solved

MS Excel How to create a warning or validation box based upon text in a particular cell

Posted on 2012-04-05
3
288 Views
Last Modified: 2012-04-05
Issue: Currently there is an IF formula to Enter text here if the "Status" in Column F = "On Hold"; Then there is conditional formatting for if the Comments Column is >0, then Highlight Yellow.

The PROBLEM is that once text is auto entered or a user types in the cell, the formula is automatically erased.

Is there a way to have a Warning Box associated with the Comments Column, so anytime a corresponding "On Hold" status is there a box will pop up informing the user to please enter comments?

This thread is directed towards fixes for issue 6- the description of the issues are also located on the Desc tab of the workbook. Issues 7-11 issues will be following in subsequent posts.

Thank you in advance for your assistance.
Test-Report-v2.xlsm
0
Comment
Question by:ckwillGWU
  • 2
3 Comments
 
LVL 41

Accepted Solution

by:
dlmille earned 300 total points
ID: 37814712
Do you want to lock the user at the cell until comments are posted?

This just prompts the user to enter comments, then lets the user continue.  See the last 2 if statements.  It prompts the user if the yellow comment is not there because it has been overwritten:

in Sheet1 codepage:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Value <> PreviousValue Then
        Sheets("log").Cells(65000, 1).End(xlUp).Offset(1, 0).Value = _
            Application.UserName & " changed cell " & Target.Address _
            & " from " & PreviousValue & " to " & Target.Value
    End If
    If Target.Count > 1 Then Exit Sub 'not handling at the moment - this is if more than one cell is changed simultaneously
    If Not Intersect(Target, Range("F:F")) Is Nothing Then
        If Target.Value = "On Hold" And Left(Range("I" & Target.Row).Formula, 1) <> "=" Then 'prompt user
            MsgBox "Please Enter comments for On HOLD status"
        End If
    End If
End Sub

Open in new window


One, perhaps better alternative could be to erase the comments and put the formula back in there?  What do you think?

See attached.

Dave
Test-Report-v2.xlsm
0
 

Author Comment

by:ckwillGWU
ID: 37814737
Thanks Dave, this works perfectly. I just modified the warning to read "Enter or Update" the comments. I'd rather leave the old comments for a running trail with each account.

Again, thanks again. 1 down :)
0
 

Author Closing Comment

by:ckwillGWU
ID: 37814742
Very quick and accurate response on the first go! :)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question