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.
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.
You can only set to an object, such range and sheet, not to a variable.
![]()
Please Login or Register to view this content.
Okay, so how would I sum column c? Could I do this using theNew to this sorry,![]()
Please Login or Register to view this content.
The last row in column c. Thanks for any help
I think![]()
Please Login or Register to view this content.
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.
You are still using set with a variable. Remove the set
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.
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
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![]()
Yes I'm still getting the "Global fail 1004" With that? I'm not sure why
No, just the activesheet, for all sheets I would do that like this:
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?![]()
Please Login or Register to view this content.
Okay but let me try your new code yudlugar, appreciate your help, thanks
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks