MsgBox Display

G

Guest

I would like to have a message box display under these conditions.

Column A = Job Status
Column B = Date Completed

If column A = Done and Column B does not have a date of completion then I
would like to have a msgbox pop up and tell the user they need to put a
completion date in column B.

Thank you
 
B

Bob Phillips

Use data validation on A2 with a custom value of =B2<>"", assuming row 2,
and an appropriate error message

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

bhofsetz

Very simply:


Code:
--------------------
Sub FillDateCompleted()
Dim NumRows As Long, x As Long
NumRows = Cells(Rows.Count, "A").End(xlUp).Row
For x = 1 To NumRows
If Range("A" & x) = "Done" And IsEmpty(Range("B" & x)) Then
Range("B" & x) = InputBox("Enter the Date Completed")
End If
Next x
End Sub
--------------------


You can use data validation to ensure a valid date is entered and
format the result on your sheet if you like as well.
You can also have the affected range be highlighted so the user more
clearly knows what job they are entering the completion date for.
You can also add an if statement after the inputbox assignment that
makes sure they entered a date.
But this should get you started

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top