+ Reply to Thread
Results 1 to 5 of 5

Drop-down list button, that inserts new row below currently selected cell

  1. #1
    Registered User
    Join Date
    04-02-2013
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    2

    Drop-down list button, that inserts new row below currently selected cell

    Hello everyone.

    I spent few hours looking for a macro that works for me, but I haven’t found exact match this far.
    Here is my intention:

    My data range is H4:H40, where in each datavalidated cell I can choose between different text strings. What im trying to, is I need „add new row“ option to my datavalidated drop-down list, that inserts new full row below currently selected cell and if „add new row“ is selected, it leaves current cell blank.
    Any information would be helpful.

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Drop-down list button, that inserts new row below currently selected cell

    Not sure i fully understand but is this the type of thing you're looking for ?

    Ans DropDown.xls

    Oops.. You need to amend the code in the worksheet module to read

    Please Login or Register  to view this content.
    Last edited by AndyLitch; 04-04-2013 at 07:35 AM. Reason: Code error
    Elegant Simplicity............. Not Always

  3. #3
    Registered User
    Join Date
    04-02-2013
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Drop-down list button, that inserts new row below currently selected cell

    Thank you for your reply Andy, but it’s still not what I meant. I want the code to loop through range H4:H40 and if text „new row“ is found, clear that cell, insert new row under it and continue looping that range.

  4. #4
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Drop-down list button, that inserts new row below currently selected cell

    Then put this code into the worksheet module

    Please Login or Register  to view this content.

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Drop-down list button, that inserts new row below currently selected cell

    Hi, hnuuma,

    just regarding the last post a slightly different code:
    Please Login or Register  to view this content.
    Do you use Data Validation or a ComboBox? Shall the new row be equipped with DV or a ComboBox as well?

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1