Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 542
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 542
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel: match two cells in one sheet to two cells in another and return a third cells value Spence Excel Worksheet Functions 3 February 13th 11 05:33 AM
join data in multiple cells when adjoining cells match criteria ?? angiec50 Excel Worksheet Functions 1 October 6th 09 10:27 AM
Cells won't change font color or show hi-lighted cells in document ROBIN Excel Discussion (Misc queries) 1 March 27th 08 09:39 PM
display a range of cells editible cells based on matching date Miki Excel Worksheet Functions 0 October 10th 07 03:27 PM
Setting of input cells as blue font and formula cells as black fon Sunnyskies Excel Discussion (Misc queries) 2 May 14th 07 05:27 PM


All times are GMT +1. The time now is 05:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"