![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 14
|
I have numbers on columns 02,p2, and q2 going all the way to row 40. I need to have to totals on j2. I can easily do the =sum(o2:q2) I would like this to be a macro. Problem is the next time I export data to those columns it will not always end at row 40. I need to have a formula in my macro that will sum whatever is in those 3 columns. Regardles what row it ends. And if there is no data, I would like it to be blank with no zeros
Any help I can get would be GREATLY APPRECIATED!!! |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
I'm not quite understanding you. You talk about a column and then indicate a cell ! For example Q2 is not a column it is the cell at the intersection point of columnQ and Row2.
Secondly how do you want the totals completed ... by row ?
__________________
<MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee> |
|
|
|
|
|
#3 |
|
New Member
Join Date: May 2002
Posts: 14
|
I am sorry, I meant columns. J to have the totals. Adding columns o thru q.
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
Maybe I'm not understanding but why not just type the formuala =O2+P2+Q2 into J2 and then drag this all the way down the column J.
As far as the zero's not showing when there is not data just goto your Tool Bar and : select "TOOLS"...."OPTOINS"...VIEW TAB.. and uncheck the "zero values" check box.
__________________
<MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee> |
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
Ok then enter =sum(O:Q) in the J2 box and drag it down the column.
If this is all you want to do I don't see there to be a need for a macro.
__________________
<MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee> |
|
|
|
|
|
#6 |
|
New Member
Join Date: May 2002
Posts: 14
|
That's what I did but I am creating a macro. If the data only goes to row 40 that's where the macro will stop. So the next time I load data (mor that 40 rows) the macro will only sum up to 40.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|