Consulting

Results 1 to 3 of 3

Thread: Solved: Pop Up Message On Cell Value

  1. #1
    VBAX Tutor
    Joined
    Oct 2012
    Posts
    298
    Location

    Solved: Pop Up Message On Cell Value

    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'.
    [vba]
    If Target.Column = 2 Then
    If Target = "No" Then
    MsgBox "Please remember to delete any future resource forecasts"
    End If
    End If[/vba]
    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:
    [vba]MsgBox "Please remember to delete any future resource forecasts"[/vba]
    to this:

    [vba]MsgBox "Please remember to delete any future resource forecasts for " & cell.Offset(0, 1).Value & ""[/vba]
    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

  2. #2
    VBAX Expert
    Joined
    Aug 2004
    Posts
    810
    Location
    Try:
    [VBA]MsgBox "Please remember to delete any future resource forecasts for " & Target.Offset(0, 1).Value & ""
    [/VBA]

  3. #3
    VBAX Tutor
    Joined
    Oct 2012
    Posts
    298
    Location
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •