VBA Help Adding Columns together by column header.

LNG2013

Active Member
Joined
May 23, 2011
Messages
466
Hello,

I have code that manipulates a csv. In the csv there are 20 sets of 4 column headers.

Eg~
Set1: A11A, A11B, A11C, & A11D
Set2: A12A, A12B, A12C, & A12D .....

Only 1 number will appear in each set per row, eg. in row one A11C = 3, in row two A11B = 7.

I want to combine each set together in 1 column.
Eg A11A+A11B+A11C+A11D = A11

The issue I am running into is the columns switch order. So I need them to be added together by the column header, and the result placed in the respective column.





<STYLE type=text/css>
table.tableizer-table {border: 1px solid #CCC; font-family: Arial, Helvetica, sans-serif; font-size: 12px;} .tableizer-table td {padding: 4px; margin: 3px; border: 1px solid #ccc;}
.tableizer-table th {background-color: #104E8B; color: #FFF; font-weight: bold;}
</STYLE>
<TABLE class=tableizer-table>
<TBODY><TR class=tableizer-firstrow><TH>A11A</TH><TH>A11B</TH><TH>A11C</TH><TH>A11D</TH><TH>A11</TH><TH>A12A</TH><TH>A12B</TH><TH>A12C</TH><TH>A12D</TH><TH>A12</TH></TR><TR><TD> </TD><TD> </TD><TD>3</TD><TD> </TD><TD>3</TD><TD> </TD><TD> </TD><TD>5</TD><TD> </TD><TD>5</TD></TR><TR><TD> </TD><TD>7</TD><TD> </TD><TD> </TD><TD>7</TD><TD> </TD><TD> </TD><TD> </TD><TD>2</TD><TD>2</TD></TR><TR><TD>6</TD><TD> </TD><TD> </TD><TD> </TD><TD>6</TD><TD>1</TD><TD> </TD><TD> </TD><TD> </TD><TD>1</TD></TR><TR><TD>4</TD><TD> </TD><TD> </TD><TD> </TD><TD>4</TD><TD> </TD><TD>3</TD><TD> </TD><TD> </TD><TD>3</TD></TR>
</TABLE>
 
Last edited:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,224,586
Messages
6,179,716
Members
452,939
Latest member
WCrawford

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