How to create macro to auto populate selected / required data into tables ?

chon

New member
Joined
Oct 9, 2013
Messages
3
Reaction score
0
Points
0
Hi guys,

I need your help as I'm not familiar on how to create macros in MS Excel.

I have a set of data relating to events which I extract from one of our databases on a regular basis. The event has a unique identifier which is the Event Id in column A as indicated in the Data Tab attachment. Each event has its own event details pertaining to each field (i.e. columns) as indicated in the Data Tab attachment.

What I would like for the macro to do is to populate the selected / required data as per the column headings highlighted in green in the Data Tab attachment corresponding to each Event Id onto the relevant fields in the table as indicated in the Table Tab attachment. One table for one event.

What I would also like for the macro to do is to be able to identify how many Event Ids there are in the Data Tab attachment and create / replicate the number of tables (including the relevant fields and cell / table formatting) required accordingly. For example, if there are 50 Event Ids in the Data Tab attachment then there will be 50 tables created / replicated prior to the selected / required data been automatically populated onto the relevant fields in each table corresponding to each Event Id.

The tables should be listed in order corresponding to the Event Ids listed in the dataset eventhough the event Ids are not sorted by value from smallest to largest or vice versa. In addition, the dataset and tables need to be on separate tab / spreadsheet within the workbook.

Thanks in advance for your help.

Kind regards,

Charles
 

Attachments

  • Data Tab.jpg
    Data Tab.jpg
    20.3 KB · Views: 134
  • Table Tab.GIF
    Table Tab.GIF
    15.8 KB · Views: 140

chon

New member
Joined
Oct 9, 2013
Messages
3
Reaction score
0
Points
0
As requested, here is the dummy workbook for your reference. Appreciate your help. Thanks.
 

Attachments

  • Dummy Workbook.xls
    27 KB · Views: 131

NoS

New member
Joined
Jan 17, 2013
Messages
832
Reaction score
0
Points
0
Location
British Columbia
Excel Version(s)
Excel 2010
Your request was a macro to create the required number of tables and fill them in from the Data sheet.

Have a look at this, I've added a separate sheet to hold a table (really more a form) to use for copying.

Hope this is of some use to you.
Good luck with the project
NoS
 

Attachments

  • Dummy Workbook(2).xls
    56 KB · Views: 369
Top