PDA

View Full Version : Solved: Pop Up Message On Cell Value



hobbiton73
11-24-2012, 07:15 AM
I wonder whether someone may be able to help me pelase.

I'm using the code below to create a 'Pop Up' message upon on a cell value being selected, in this case, the word 'No'.

If Target.Column = 2 Then
If Target = "No" Then
MsgBox "Please remember to delete any future resource forecasts"
End If
End If
The code works fine, but I would now like to extend this a little further and populate part of the message with a value from the next column.

I've amended this line:
MsgBox "Please remember to delete any future resource forecasts"
to this:

MsgBox "Please remember to delete any future resource forecasts for " & cell.Offset(0, 1).Value & ""
but when I run this, I receive the follwoing error:


Run time error '91': Object variable or With block variable not set and I'm not sure why.

I just wondered whether someone could possibly have a look at this please and let me know where I'm going wrong.

Many thanks and kind regards

JKwan
11-24-2012, 08:07 AM
Try:
MsgBox "Please remember to delete any future resource forecasts for " & Target.Offset(0, 1).Value & ""

hobbiton73
11-24-2012, 08:37 AM
Hi @JKwan, thank you very much much for taking the time to reply to my post.

Your solution works perfectly, thank you vey much.

All the best and kind regards