how to add up the same row id to different columns

yanm11

New Member
Joined
Aug 10, 2022
Messages
7
Office Version
  1. 365
Platform
  1. Windows
hey,
thanks to anyone who is willing to help.
this is the raw data:

1665059316564.png



then after changing a bit the data with vba i get it to this format:

1665059414470.png



now the problem here its that we get the same employee number for a few rows.
so instead of having one row for number 1111111 and three columns with the salary we get three differenet rows.

this is how i want it look:
1665059660312.png





A few notes, the number of columns is changing every month and so is the number of rows. my macro brings it to this format but i need one that continue and agragate the rows.

thanks a lot to those who help.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
It is very difficult to say something without seeing the code.
You must loop through each employee number column at Table 2 on each iteration to check if you are writing data for the same employee or not.
If it is the same employee number, then, stop there and write your data there. If not, continue iteration and write to new row.
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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