+ Reply to Thread
Results 1 to 8 of 8

To insert new rows into a table using a custom dialog box

  1. #1
    Forum Contributor jimmalk's Avatar
    Join Date
    08-31-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    113

    To insert new rows into a table using a custom dialog box

    Hello. My goal is to be able to select any cell in a table , click a button with attached code , and have a dialog box come up offering to insert x-number of new rows after the row of the selected cell. In the dialog box would have user input: a) of the number of new rows to insert (defaulted to 1, maybe with a field with a spin control?), and b) if the new rows should be empty or clones of some of the columns in the original selected cell. I hope I expressed this ok.

    In the sample spreadsheet, I would like to be able to (for example) select [E12], and insert down either partial clones of row 12 x-number of times (user input), or x-number of blank rows. Only columns C:I, L:L would be cloned down if clone copying is chosen by the user. I dont have experience in custom dialog boxes. I imagine a good way to pass the contents of a cloned row to the dialog box would be through an array, but I dont know how to set up and pass the array to the dialog box and then return the user input back into an .Insert Shift:=xlShiftDown to execute the insert. Maybe this is a common type of question. I appreciate if anyone has a 'canned' solution they could share. Thanks very much.
    Attached Files Attached Files
    Last edited by jimmalk; 10-10-2012 at 04:19 AM.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: To insert new rows into a table using a custom dialog box

    try the attached workbook and let me know :-)
    Attached Files Attached Files
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Contributor jimmalk's Avatar
    Join Date
    08-31-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: To insert new rows into a table using a custom dialog box

    Awesome!! Really great Joseph!! It is exactly what I want to do, with only one exception. On the clone control I need to specify which fields are to be cloned. It will vary. Maybe a checklist of all the fields where the "to be cloned field" gets checked off if it is to be cloned? But this is really awesome. I am learning evrything with excel now and forms are still an area that I dont know anything. Thank you so so much. Un abrazo grande!!

  4. #4
    Forum Contributor jimmalk's Avatar
    Join Date
    08-31-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: To insert new rows into a table using a custom dialog box

    I see I didnt write clearly in my original post about the cloning being for variable fields, and not strictly fixed (I meant those columns to be examples, but not fixed). I apologize for not being clear, I just noticed that now.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: To insert new rows into a table using a custom dialog box

    ok. I need to get a couple hours sleep now but I'll work on it later

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: To insert new rows into a table using a custom dialog box

    this should get you pretty close even if it's not exactly what you want
    Attached Files Attached Files

  7. #7
    Forum Contributor jimmalk's Avatar
    Join Date
    08-31-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: To insert new rows into a table using a custom dialog box

    Absolutely awesome Joseph!!! Not only is it perfect, but the code is so compact. I'm really looking forward to figuring out how it works. I'll only have to adapt it a little bit its so perfect. Really, really cool!!! Thank you so much!!! Un abrazo muy grande amigo!!! (I dont actually speak much Spanish, but I like practicing it) haha Thank you very much Joe. It's really a great help to me Best Wishes..
    Last edited by jimmalk; 11-16-2012 at 04:46 AM.

  8. #8
    Forum Contributor jimmalk's Avatar
    Join Date
    08-31-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: To insert new rows into a table using a custom dialog box

    I'm trying to click your rep star, but it doesnt let me because I think I just repped you yesterday. But I'm getting back to this post to rep you again when it lets me. To anyone who ever sees your solution, I'm sure they'll find it really useful!! Thanks so much

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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