+ Reply to Thread
Results 1 to 17 of 17

Need to sum up Columns A3 to to A30 and then add total in B32

  1. #1
    Registered User
    Join Date
    06-10-2016
    Location
    Kansas City
    MS-Off Ver
    2013
    Posts
    14

    Need to sum up Columns A3 to to A30 and then add total in B32

    I'm trying to figure out how to total Columns from the cell range of A3 to the whenever, I have 51 sheets and each sheet has different cells populated.
    Example:
    Sheet1 - might have 8 populated cells from A3 to A8 - I need the total populated in B12.
    Sheet2 - might have 370 populated cells from A3 to A273 - I need the total populated in B375.

    Current Code and it does not work:
    It produces =A6 in row 23 column A

    Dim LR As Long
    With Sheets("Sheet1")
    LR = .Range("A" & Rows.Count).End(xlUp).Row
    Range("A3" & LR).Formula = "=A6"
    End With


    Thanks,
    Rubi

  2. #2
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    Hello Rubi,

    Taking your first example:

    Sheet1 - might have 8 populated cells from A3 to A8 - I need the total populated in B12.
    You could try either of the following:-


    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    within your code.

    The second option will define the actual used cells whereas the first option just checks the whole column.

    I hope that this helps.

    Cheerio,
    vcoolio.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    Try something like this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    06-10-2016
    Location
    Kansas City
    MS-Off Ver
    2013
    Posts
    14

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    Thanks AlphaFrog..All I get back is =SUM(R3C1:R[-2]C1) in the cell.

  5. #5
    Registered User
    Join Date
    06-10-2016
    Location
    Kansas City
    MS-Off Ver
    2013
    Posts
    14

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    Thanks vcoolio ......It brings back a value of "0" in B12.

    Looking for the cell count from what ever is in A3 to whatever cell is populated after A2.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    Quote Originally Posted by Rubicon9 View Post
    Thanks AlphaFrog..All I get back is =SUM(R3C1:R[-2]C1) in the cell.
    It works for me. Is column B formatted as text? If yes, change the column format or try this...
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-10-2016
    Location
    Kansas City
    MS-Off Ver
    2013
    Posts
    14

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    Quote Originally Posted by AlphaFrog View Post
    It works for me. Is column B formatted as text? If yes, change the column format or try this...
    Please Login or Register  to view this content.
    Getting closer...now it populates with '0'...doesn't count the cells .

  8. #8
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    @AlphaFrog,

    I would say, at a stab, that Column A is actual text. Rubi may be needing COUNTIFS.
    Anyway, I'll leave it with you. I'm going to bed!

    Goodnight people.

    vcoolio.

  9. #9
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    Then column A is formatted as text as well. Try this...

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    06-10-2016
    Location
    Kansas City
    MS-Off Ver
    2013
    Posts
    14

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    Quote Originally Posted by vcoolio View Post
    @AlphaFrog,

    I would say, at a stab, that Column A is actual text. Rubi may be needing COUNTIFS.
    Anyway, I'll leave it with you. I'm going to bed!

    Goodnight people.

    vcoolio.
    Column A has text in A1 and A2...A3 down only has Facility ID's that we use. Such as A3=072.... I just need to know how many facilities there are in each of the rows in that column of A3 to lets just say 1000.....Sorry for the confusion.

    Rubi

  11. #11
    Registered User
    Join Date
    06-10-2016
    Location
    Kansas City
    MS-Off Ver
    2013
    Posts
    14

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    Quote Originally Posted by AlphaFrog View Post
    Then column A is formatted as text as well. Try this...

    Please Login or Register  to view this content.
    Column A has text in A1 and A2...A3 down only has Facility ID's that we use. Such as A3=072.... I just need to know how many facilities there are in each of the rows in that column of A3 to lets just say 1000.....Sorry for the confusion.

    Rubi

  12. #12
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    You just want to count the number of entries in column A starting at A3 and not SUM the values?

  13. #13
    Registered User
    Join Date
    06-10-2016
    Location
    Kansas City
    MS-Off Ver
    2013
    Posts
    14

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    Quote Originally Posted by AlphaFrog View Post
    You just want to count the number of entries in column A starting at A3 and not SUM the values?
    Exactly. I apologize for the confusion, I'm new at this.

    Rubi

  14. #14
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    If there are no empty rows in between.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  15. #15
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    06-10-2016
    Location
    Kansas City
    MS-Off Ver
    2013
    Posts
    14

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    Quote Originally Posted by AlphaFrog View Post
    Please Login or Register  to view this content.
    Hey there AlhaFrog--- That Worked!!!!!...Now I can't figure out how to put that value in H2.

    Rubi

  17. #17
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Need to sum up Columns A3 to to A30 and then add total in B32

    Replace this...
    .Value = .Row - 4
    With this...
    Range("H2").Value = .Row - 4

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] sum columns for YTD total
    By humpaco in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-01-2018, 08:08 AM
  2. Sum columns for YTD total
    By Neilesh Kumar in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-26-2016, 01:24 PM
  3. Total for two Different Columns
    By Mrrickc in forum Excel General
    Replies: 1
    Last Post: 10-01-2014, 08:05 PM
  4. I need to filter and total my columns
    By johnkitchens in forum Excel General
    Replies: 2
    Last Post: 06-07-2010, 12:05 PM
  5. Total only specific columns
    By fengfeng in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2009, 10:40 PM
  6. Function recognizes two columns and adds total of two other columns
    By grafx77 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-18-2007, 09:09 AM
  7. how do i add up 3 columns to get a total
    By dekmag in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 12-26-2005, 04:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1