Inserting a Row

  • Hello,


    I have a macro written on a specific sheet (not a module). What it does is when a selection is made in the dropdown in C2, it populates, in the adjacent cell, D2, another dropdown depending on the selection in C2.


    This work perfectly.


    However, this configuration will not allow me to insert a row, which pushes the data in Row 2 to Row 3.


    Here is the code on the sheet.


    When I insert a row, I get MSVB error: Run-Time error '13': Type Mismatch


    When I click Debug, it sends me here:




    Any help would be epic, I have been struggling with this.


    Thanks

    Marc


  • Add this line of code, it should be enough to avoid "error 13". If more than one cell is selected, it exits the macro. It also helps if you delete more than one cell at a time.

    Code
    If Target.CountLarge > 1 Then Exit Sub        '<- added
    If Not Intersect(Target, Range("C:C")) Is Nothing Then
    '...

Participate now!

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