+ Reply to Thread
Results 1 to 8 of 8

Auto create form multiple times

  1. #1
    Registered User
    Join Date
    10-21-2014
    Location
    Macedonia
    MS-Off Ver
    2010
    Posts
    69

    Auto create form multiple times

    Hello,

    I am exporting a list of details from a software to Excel.

    Please see the file attached (Sheet1:"Detail")

    1. I would like to create a macro with which a form (please see sheet2: "Form" in the sample) will be created as many times as there are number of entries in sheet1: "Detail".
    2. The macro should identify the end of each record to know when to insert another form in the second sheet. If the entry has only one row of populated data than only that row will copy it self from sheet 1 into the relevant form in sheet 2. If the entry has multiple rows of data (entry number 3 in the sample), than data from those multiple rows should be copied into one form.

    Each export will contain different number of entries (the sample attached contains 3 entries).

    At the end I would like to print each of the forms (sheet 2) individually.

    The sample file can be downloaded from:

    http://www36.zippyshare.com/v/38170509/file.html

    Or can be taken from the attachments of this post.

    Thank you so much for your kind help with the matter.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Auto create form multiple times

    try this macro
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-21-2014
    Location
    Macedonia
    MS-Off Ver
    2010
    Posts
    69

    Re: Auto create form multiple times

    Quote Originally Posted by rcm View Post
    try this macro
    IT WORKS! I just added the template sheet to the original file. "Template" was not found originally in the file with the "Detail" export.

    Once again thank you so much. Your enormous help is truly appreciated!

    I wonder whether the macro can automatically copy the "Template" sheet to the "Book1" that is exported from the software in Excel.
    Last edited by gokica; 11-01-2014 at 11:04 AM.

  4. #4
    Registered User
    Join Date
    10-21-2014
    Location
    Macedonia
    MS-Off Ver
    2010
    Posts
    69

    Re: Auto create form multiple times

    Quote Originally Posted by rcm View Post
    try this macro
    Once again thank you so much just in case the updated post is not visible for you.

    Edit:

    I noticed that there is a macro part that should copy the template before sheet 1 but it is working only on the macro workbook but not on the exported file.

    And one more thing please. The filled forms are printed on individual sheets. And this will work just fine since for printing I will just select the entire workbook. At the end I will just print from form 1 till the end (without the "detail" and the "template". But it would be easier if I could have all of the forms in one sheet divided as pages for printing. For example one sheet named Forms and in it form 1 as page 1 than followed by form 2 as page 2 etc. So one sheet with all of the forms listed.

    I am most grateful for your input.
    Last edited by gokica; 11-01-2014 at 12:02 PM.

  5. #5
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Auto create form multiple times

    Here is my effort.

    This creates the form, but doesn't address the printout. Maybe later.....
    Attached Files Attached Files
    David
    (*) Reputation points appreciated.

  6. #6
    Registered User
    Join Date
    10-21-2014
    Location
    Macedonia
    MS-Off Ver
    2010
    Posts
    69

    Re: Auto create form multiple times

    Quote Originally Posted by Tinbendr View Post
    Here is my effort.

    This creates the form, but doesn't address the printout. Maybe later.....
    Thank you so much. Works wonderful. I have so much to learn from your's and rcm's macros.

  7. #7
    Registered User
    Join Date
    10-21-2014
    Location
    Macedonia
    MS-Off Ver
    2010
    Posts
    69

    Re: Auto create form multiple times

    Quote Originally Posted by rcm View Post
    try this macro
    I would just like to ask for a modified code which will copy only the first 6 characters from column K and the first 8 characters from column M. The rest is working fine. I will figure out a way how to copy the template automatically.

    Thank you so much and sorry to bother you.

  8. #8
    Registered User
    Join Date
    10-21-2014
    Location
    Macedonia
    MS-Off Ver
    2010
    Posts
    69

    Re: Auto create form multiple times

    Hello again,

    I would just like to ask if the template has 6 predefined rows for copying data from the source sheet, I would appreciate if someone provides a code (macro) that will automatically add rows for copying more than 6 cells from the source sheet only in case there are more than 6 cells to be copied. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 10-01-2014, 12:16 PM
  2. Sequential Numbering of a Form Printed Multiple Times
    By MMRANCH02 in forum Excel General
    Replies: 4
    Last Post: 04-02-2014, 03:53 PM
  3. Same form opened multiple times
    By alsega in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-12-2012, 10:31 AM
  4. Help with formula to auto create break times
    By avidcat in forum Excel General
    Replies: 4
    Last Post: 01-15-2012, 05:08 PM
  5. Replies: 1
    Last Post: 10-24-2007, 08:31 PM

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