Posts by dgasca

    Hello. I am new to VBA. I have looked and looked and tried to use Excel Help from Microsoft, but can't seem to get something to work.


    I want to have a message box pop up with yes and no questions once a cell has a value on it. But once that value is entered, I would like it to look at previous cells to see what code to run to unhide rows. I had a macro set up to unhide rows based on a button the user would click, but I would like to have a box pop up and have the user select Yes to run macro instead of user selecting it. But depending on a previous cell, it could run a different macro.


    here is a snippet of my code:


    Where UnhideinfoEXP is the macro that basically unhides row 60 and 48-52. This coding works, except when I click No, it still runs the macro.


    Also, if the answer is to the pop up is Yes, I would like it to look at cell 44 to see if it says DEP, and if so to also to unhide row 67, if not only unhide those listed.


    I guess I can start with the yes and no button to decide if things should be hidden or not, but I am not familar with changing a popup message to have Yes/No and have the Yes result action depend on a different cell value as what action to unhide while the NO action would basically hide rows 80-90


    Please bare with me as I can not post my workbook to the forum, and if I am unclear, I am also sorry.


    David

    Re: Creating Pop Up Message after value is entered in cell without repeating


    Quote from royUK;667387

    This is one way


    Code
    Option Explicit
    
    
    Private Sub Worksheet_Change(ByVal Target As Range)
        Select Case Target.Address
        Case "$D$2", "$D$6"    'add cells here
            If Target.Value = "Yes" Then MsgBox "Notice...."
        End Select
    End Sub


    Thank you for this. This is helpful I needed different pop ups for different cells and I used this which seems to work.


    Code
    Option Explicit
    
    
    Private Sub Worksheet_Change(ByVal Target As Range)
        Select Case Target.Address
        Case "$D$2", "$D$6"    'add cells here
            If Target.Value = "Yes" Then MsgBox "Notice...."
        End Select
    End Sub



    [/QUOTE]


    Actually I got it to work. I basically did this:




    David

    Hello Forum.


    I have review the forum and I am really new to VB, but I am looking to have a popup message box after I enter in a value in a cell, but I don't want it to repeat when I enter a value in a different cell.


    if Cell D2 is updated or changed to "YES" a message come up with "NOTICE......"
    Continue and enter a value in cell D3 and nothing happens.
    Continue and enter a value in cell D6 "YES" and a different message come up like "STOP......"


    What I have tried from the posts here, everytime I update a cell in the worksheet, the first message comes up again. Then when I get to the D6 cell, the first and second message pops up and so on down the cells. I am only looking for the pop ups to happen once when that "YES" value is entered in the specific cell.


    Any ideas.


    Thank you.


    David