+ Reply to Thread
Results 1 to 14 of 14

Sum Lastrow formula!!

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    259

    Sum Lastrow formula!!

    Hi, I'm not sure where I'm going wrong with this formula? I cannot specify a worksheet as they vary. Thanks

    Please Login or Register  to view this content.
    Last edited by Hurricanefly; 05-17-2013 at 11:57 AM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sum Lastrow formula!!

    You can only set to an object, such range and sheet, not to a variable.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-09-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    259

    Re: Sum Lastrow formula!!

    Okay, so how would I sum column c? Could I do this using the
    Please Login or Register  to view this content.
    New to this sorry,

  4. #4
    Forum Contributor
    Join Date
    05-09-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    259

    Re: Sum Lastrow formula!!

    The last row in column c. Thanks for any help

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Sum Lastrow formula!!

    Please Login or Register  to view this content.
    I think

  6. #6
    Forum Contributor
    Join Date
    05-09-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    259

    Re: Sum Lastrow formula!!

    I get an object fail 1004 with that, but thanks anyway. This works just needs a little formatting then good to go, cheers guys.

    Sub Sum_Last_Row()

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Sum Lastrow formula!!

    You are still using set with a variable. Remove the set

  8. #8
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Sum Lastrow formula!!

    Are you trying to get the result into the cell at the end of the column C? If so, and you are defining Lastrow as a range object then you are right to use the set and that is also why the code I gave didn't work, you would need:
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    05-09-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    259

    Re: Sum Lastrow formula!!

    If I remove that I get the fail again!, all I need it to do is sum column c in about 25 tabs in a workbook and it is doing what I want it to do, unless you have any other ideas? Its going to loop through the active workbook and sheets and sum column c. As i'm new this works for me! but open to all suggestions

  10. #10
    Forum Contributor
    Join Date
    05-09-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    259

    Re: Sum Lastrow formula!!

    Thanks yudluga I will try it, This will work in all the worksheets in the workbook? well I guess I will find out in a min

  11. #11
    Forum Contributor
    Join Date
    05-09-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    259

    Re: Sum Lastrow formula!!

    Yes I'm still getting the "Global fail 1004" With that? I'm not sure why

  12. #12
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Sum Lastrow formula!!

    No, just the activesheet, for all sheets I would do that like this:
    Please Login or Register  to view this content.
    Edit - I've tested all the code I've put and it all works without error on my setup. Could you upload a workbook with the code as you are getting an error?

  13. #13
    Forum Contributor
    Join Date
    05-09-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    259

    Re: Sum Lastrow formula!!

    Okay but let me try your new code yudlugar, appreciate your help, thanks

  14. #14
    Forum Contributor
    Join Date
    05-09-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    259

    Re: Sum Lastrow formula!!

    Okay for some reason that doesnt do anything on mine! perhaps I'm doing something wrong, I will upload the workbook, I'm using the code below to sum columns C:J, just need to make some alterations but it seems to work for me


    Please Login or Register  to view this content.

    My one is MACRO TEST COPY
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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