![]() |
VBA to SUM only certain cells
I have no clue on this one or how to even start it. I have a spreadsheet
with data in a row, the data starts at G2 and goes until AS2. I want to "SUM" this data but the complicated part comes now.... In some cases I want to to SUM G2 thru S2, or AA2 thru AN2, or even G2 thru AS2. The results would need to be placed in AU2. I really dont have a set of standards that I SUM, it is all dependent on what values I have in these cells and what I plan on doing with them that day. Is it possible to write a code that allows the user to pick the cells they want to sum, such as dragging over the cells needed? Thanks again for the help. |
VBA to SUM only certain cells
Until you get a VBA option there is a manual way to do it. Type =sum( then
select the first cell or range in the equation, hold down the Ctrl key on your keyboard and continue to click individual cells or ranges. Don't let go of Ctrl until you are finished with your selection. Type ) and hit the enter key. This will create a SUM function with the cells you would like to add. Here's an example of how it may look: =SUM(A3:C5,D6:E11,B15:E16,H3,I8,G10:G15) Good luck. "James" wrote: I have no clue on this one or how to even start it. I have a spreadsheet with data in a row, the data starts at G2 and goes until AS2. I want to "SUM" this data but the complicated part comes now.... In some cases I want to to SUM G2 thru S2, or AA2 thru AN2, or even G2 thru AS2. The results would need to be placed in AU2. I really dont have a set of standards that I SUM, it is all dependent on what values I have in these cells and what I plan on doing with them that day. Is it possible to write a code that allows the user to pick the cells they want to sum, such as dragging over the cells needed? Thanks again for the help. |
VBA to SUM only certain cells
That is what I do now, but I am trying to automate this spreadsheet as much
as possible and trying to push all the calculations through code to eliminate errors. Thank you though "SheriTingle" wrote: Until you get a VBA option there is a manual way to do it. Type =sum( then select the first cell or range in the equation, hold down the Ctrl key on your keyboard and continue to click individual cells or ranges. Don't let go of Ctrl until you are finished with your selection. Type ) and hit the enter key. This will create a SUM function with the cells you would like to add. Here's an example of how it may look: =SUM(A3:C5,D6:E11,B15:E16,H3,I8,G10:G15) Good luck. "James" wrote: I have no clue on this one or how to even start it. I have a spreadsheet with data in a row, the data starts at G2 and goes until AS2. I want to "SUM" this data but the complicated part comes now.... In some cases I want to to SUM G2 thru S2, or AA2 thru AN2, or even G2 thru AS2. The results would need to be placed in AU2. I really dont have a set of standards that I SUM, it is all dependent on what values I have in these cells and what I plan on doing with them that day. Is it possible to write a code that allows the user to pick the cells they want to sum, such as dragging over the cells needed? Thanks again for the help. |
All times are GMT +1. The time now is 04:50 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com