VBA code for converting a dynamic list of records to a table and back

Amer33

New Member
Joined
Oct 1, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello all,
I've been struggling with setting up vba code to convert a list to a table and back. I hope someone can help me.

I've got a sheet with 4 columns and a number of records. The columns are:
  • - Location - there are only two types: Customer meeting, Executive meeting
  • - Measure (eg energy consumption)
  • - Date period (month)
  • - Value; (in case of energy consumption this would be a kwh figure)
What I want to do is:
  1. - A macro to convert the original data (the import sheet see jpg1) to a table (on another sheet (called table see jpg2 ) . This table should list the record in a table month. I want user to be able to add/change value data to/in that table (indicated by red numbers in the example)
  2. - A second macro to convert the table back into a vertical list of records, similar to the import sheet but now with the added/changed value data in (see export sheet jpg 2).
The number of records will vary so the first macros needs to identify the number of records and the number of months.

Hope someone can help me in the right directon..

Amer
 

Attachments

  • jpg 2.png
    jpg 2.png
    38.9 KB · Views: 14
  • jpg 3.png
    jpg 3.png
    42.9 KB · Views: 13
  • jpg 1.png
    jpg 1.png
    46.3 KB · Views: 11

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,214,984
Messages
6,122,601
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top