[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2012-04-05
3
Medium Priority
?
295 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 42

Accepted Solution

by:
dlmille earned 1200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

649 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