Add A Line When Another Cell Is Selected

  • Hello!


    I'm not sure there is a way to do this, but if there is, I'd be very grateful to anyone who can help.


    I have spreadsheet where I want the customer to be able to click a cell and have it put in another line for them. My problem is, with the macro I have now, it continues to add lines indefinately every time you click the sheet. I want it to only add one line.


    This is what I have so far:


    Code
    'Multiple Start Stop Dates
        If Range("B8") = "X" Then
        Application.Run "InsertRowsAndFillFormulas", 1
        End If


    which goes to this:



    Thanks in advance for your help!


    - Jen

  • Re: Add A Line When Another Cell Is Selected


    This would do it just once (per Excel being opened) when invoked from the Change Cell Worksheet event, which I assume you're using here.


    Code
    static y%
    
    
        'Multiple Start Stop Dates
        If Range("B8") = "X" and y = 0 Then
        Application.Run "InsertRowsAndFillFormulas", 1
        y = 1
        End If

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!