+ Reply to Thread
Results 1 to 7 of 7

Create macro that fills table form, from one row data.

  1. #1
    Registered User
    Join Date
    12-22-2018
    Location
    Leskovac
    MS-Off Ver
    2013
    Posts
    4

    Create macro that fills table form, from one row data.

    Hi guys,

    I have one task that i would like to get some help, if someone is kind enough and have time to take a look.

    I attached the file with one manually filled example. In sheet1 i have multiple rows on some data, in sheet2 i have table form and one filled example how the data from sheet1 rows should be distributed in table.

    So i need some code to be able to auto create multiple 1000+ tables from respective number of rows in sheet1.

    Many thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Create macro that fills table form, from one row data.

    Hi,

    See the attached. It uses the following macro.

    The macro loop is set to 10. Remove the 10 so that it reads For x = 1 to lrows
    1000 rows may take some time so it would be better to create an array in VBA and process the array.

    I'll do that a bit later

    That said, wouldn't a Mail Merge Labels in Word be preferable?



    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Richard Buttrey; 12-22-2018 at 03:50 PM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Create macro that fills table form, from one row data.

    Mmmm

    Came to look at using a VBA array. It's simple enough to read the data into VBA as an array but building an output array , particularly where merged cells are involved is a little trickier. Needs more thought........

  4. #4
    Registered User
    Join Date
    12-22-2018
    Location
    Leskovac
    MS-Off Ver
    2013
    Posts
    4

    Re: Create macro that fills table form, from one row data.

    I appreciate your time man. The first solution works fine for me, as far as i saw for this testing purpose. Tomorrow I will put it on some more serious task in terms of much more data. But i think it should do the job.

    So don't need to put much more thought into it, unless you want so ofc.

    Many thanks!

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Create macro that fills table form, from one row data.

    Here's the array macro which of course is much much quicker

    Please Login or Register  to view this content.
    Last edited by Richard Buttrey; 12-22-2018 at 06:56 PM.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Create macro that fills table form, from one row data.

    Quote Originally Posted by CiraLoC View Post
    I appreciate your time man. The first solution works fine for me, as far as i saw for this testing purpose. Tomorrow I will put it on some more serious task in terms of much more data. But i think it should do the job.

    So don't need to put much more thought into it, unless you want so ofc.

    Many thanks!
    Glad to have helped and thanks for the rep

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Create macro that fills table form, from one row data.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] How to create a fill-in form that takes 2 data from dropdown lists and add them to a table
    By koko191 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-11-2016, 02:03 AM
  2. Macro that fills entire table row based on first row value and another cell
    By Zexze in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-06-2016, 12:22 PM
  3. Macro to create zip files from form to capture data.
    By dtechpcs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-02-2015, 11:33 AM
  4. [SOLVED] Macro only fills data from the 1st 3 coloumns
    By Shellybelly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2015, 08:46 PM
  5. Create / Persolalise a form with data from a table
    By Rich Whitfield in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2014, 07:08 PM
  6. [SOLVED] create input form from dropdown list and save data in table
    By Bax in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-20-2013, 06:21 AM
  7. Replies: 3
    Last Post: 04-15-2009, 11:50 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