• Status: Solved
  • Priority: Low
  • Security: Public
  • Views: 51
  • Last Modified:

VBA code required for different subtotals across multiple columns.

VBA code required for different subtotals across multiple columns.
i.e. on running a macro the next available line should have subtotal(9,..., for columns H, J, K, M, N, O, P, Q, S, U, V, W, X and subtotal(1,.... for column Y.
Any help would be appreciated.
0
Steve Grundy
Asked:
Steve Grundy
  • 7
  • 4
1 Solution
 
Roy CoxGroup Finance ManagerCommented:
Why VBA? Use a Table and you can add this feature called a Total Row.

Overview of Excel tables

Once set up this is automatic
0
 
Steve GrundyAuthor Commented:
Hi Roy,
It’s a function of a new cost sheet I’m developing.
I may require multiple subtotal lines as above to cover different assembly options.

Thanks.
0
 
Roy CoxGroup Finance ManagerCommented:
There's a SubTotal Function from the Data Tab, but if you mean adding subtotals within the data then that will affect totals below.

Attach an example workbook.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Steve GrundyAuthor Commented:
Hi Roy,

I hope you had a good Easter Break?
Please see attached example sheet, the idea being I could cost up several assemblies (i.e. 3-4 rows per assembly) and subtotal each one up as I go,  I was hoping to achieve this with a Macro so users of all competences could use it trouble free.

Costing sheet example
0
 
Roy CoxGroup Finance ManagerCommented:
Easter was a long needed rest, thanks.


Can you attach the workbook. Pictures aren't a great help.
0
 
Steve GrundyAuthor Commented:
I echo you Roy!

Here you go.....
Costing-Sheet-R51---DEVELOPMENT.xlsx
0
 
Roy CoxGroup Finance ManagerCommented:
I'll take a look later
0
 
Roy CoxGroup Finance ManagerCommented:
Hi  Steve

I've added a button with code to sub total the data based on Product Code. Is this  what you mean?
Costing-Sheet-R51---DEVELOPMENT--2-.xlsm
0
 
Steve GrundyAuthor Commented:
Hi Roy,

That looks like it might work for me, I can update the array to sum up each of the required columns, THANKS!
0
 
Roy CoxGroup Finance ManagerCommented:
Just SubTotal manually but record the actions with the Macro Recorder. The code will need editing but I'll help you with that.
0
 
Roy CoxGroup Finance ManagerCommented:
Seems the author was satisfied
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now