Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: adding columns with macros

  1. #1
    New Member
    Join Date
    May 2002
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #2
    MrExcel MVP
    Join Date
    Apr 2002
    Location
    Vancouver BC , Canada
    Posts
    6,259
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #3
    New Member
    Join Date
    May 2002
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I am sorry, I meant columns. J to have the totals. Adding columns o thru q.

  4. #4
    MrExcel MVP
    Join Date
    Apr 2002
    Location
    Vancouver BC , Canada
    Posts
    6,259
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #5
    MrExcel MVP
    Join Date
    Apr 2002
    Location
    Vancouver BC , Canada
    Posts
    6,259
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #6
    New Member
    Join Date
    May 2002
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •