Solved

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

Posted on 2012-04-05
3
286 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvieā€¦
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now