Is what I'd like to do even possible?

Ergocorp

New Member
Joined
May 2, 2019
Messages
4
Hi, I've taken plenty of advise from this forum, so much so that I've only needed to register now, so thank you all.

I get data from external sources in the form of a table that has every month of a year. I'm looking for a way to automate the transfer of a specific month's sum to another spreadsheet, and then again with certain filters on. The table might increase in number of rows every month I receive it eg.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Filter 1[/TD]
[TD]Filter 2[/TD]
[TD]Jan[/TD]
[TD]Feb[/TD]
[TD]Mar[/TD]
[TD]Apr[/TD]
[TD]May[/TD]
[TD]Jun[/TD]
[TD]Jul[/TD]
[TD]Aug[/TD]
[TD]Sep[/TD]
[TD]Oct[/TD]
[TD]Nov[/TD]
[TD]Dec[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]a[/TD]
[TD]x[/TD]
[TD]5[/TD]
[TD][/TD]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]a[/TD]
[TD]y[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]a[/TD]
[TD]z[/TD]
[TD][/TD]
[TD]3[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]a[/TD]
[TD]z[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]b[/TD]
[TD]z[/TD]
[TD]5[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]b[/TD]
[TD]y[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]b[/TD]
[TD]x[/TD]
[TD]4[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]a[/TD]
[TD]x[/TD]
[TD][/TD]
[TD][/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD][/TD]
[TD][/TD]
[TD]17[/TD]
[TD]12[/TD]
[TD]18[/TD]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Is this even possible with VBA and a macro? Would I need to clean the table somehow?

Thanks.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
How do you decide which month and where on the other sheet do you want to transfer the month's sum?
 
Upvote 0
I do a monthly report, so I get that data every month. In essence the data I get is the same as the previous month with an extra month. Because this is a report on the previous month, I'd want current month -1. I get 10 sets of data each a tiny bit different depending on their own systems and little quirks. I have an aggregation work book where I collate the data, sums up the filters across at 10 etc. I then have a master workbook that I transfer that data to using macros that forms a dashboard. I'm conscious I could lose the aggregation workbook and take the data directly, but one step at a time :)
 
Upvote 0
To clarify: This is the month of May so you want to find the total for April from the row that has "Total" in column A. If this is correct, I'm still not clear on where you want to paste this total for April. Do you want to transfer the total to your master workbook? If so, what is the full name of the master workbook including extension (xlsx, xlsm), what is the name of the destination worksheet in the Master and in what cell in that sheet do you want the total?
 
Upvote 0
I'm not really able to broadcast that on the internet, so I've tried to as generic as possible. It's not just May for example. When I come to do the report for say September, I want to total up all the rows for that month, and for November's report to count up the rows for that one.

There's already a total, why don't I just use that? Not all of the external data sources use a total.


Would I just be better creating specific macros for each source, then doing some sort of aggregation macro? I think so. I'm waffling here as I think I'm coming up with a way to do it that way I want, sorry for wasting your time.

How do you mark this as answered?
 
Upvote 0
Unfortunately, you can't mark the thread as solved in this Forum. Not to worry. You didn't waste my time. :)
 
Upvote 0
Ok, so I have been able to do some of the Formulae. Using INDIRECT and COUNT I was able to create a sum range that counts the number of rows, but I'm struggling when it comes to the column. Ignoring that data transfer to another work book element, assuming we don't have a total row, the above example would allow for a variable number of rows:

=SUM(G2:INDIRECT("G"&COUNT(A:A)))

However my next step is a variable column. The columns are headed with the month, as per the above example. I get a new version every month, increasing in row number (thus the need for that variable number), but filling out a new column of data. Si in this case, it was Apr. Replace 'G' with 'H' and you'd get May etc. Any one any idea how I pick out a specific column with a catch all macro?
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,215
Members
452,618
Latest member
Tam84

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