Hope somebody can help please. I need a Macro to autosum from a selected row cell in column D and perform autosum in all rows above it until it reaches the last autosum row. I need this to work from column D to AB.
Hope somebody can help please. I need a Macro to autosum from a selected row cell in column D and perform autosum in all rows above it until it reaches the last autosum row. I need this to work from column D to AB.
Hello Stratfordoaks,
Welcome to the Forum.
Check if the attached WorkBook is what you have in mind.
Also see the "Please consider" note at the bottom of this Post.
Please consider:
Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .
Hi, Winon,
I´m not so sure about the AutoSum range being a determined range but TO may clear that.
I would have taken a Loop instead of writing all the formulas:
Ciao,Please Login or Register to view this content.
Holger
Use Code-Tags for showing your code: [code] Your Code here [/code]
Please mark your question Solved if there has been offered a solution that works fine for you
@ HaHoBe,
Hello "Ciao",
I couldn't agree with you more Holger.
The only thing is that I am not sure as to what level of VBA skills the OP has to understand what Dims, Constants and Loops are.
So I kept it simple basic "Longhand".
Hi Winon
Thanks for your reply. I forgot to mention that I need this macro to start in the active cell which could be any row in column D and then run macro to sum above to the last row containing an autosum or this could be a blank line. I have linked my worksheet to show you.
Worksheet
Hello Stratfordoaks,
The file download was reported as unsafe, containing viruses, etc. So I had to abort the Download. Please could you upload your Workbook via the Forum Posts by Clicking on Go Advanced, and upload from there.
Thank you.
Hi, Stratfordoaks,
if you offer a workbook for download I would get rid of every link to another workbook on your Desktop.
Give this a try:
Ciao,Please Login or Register to view this content.
Holger
Hi Winon
Ok here it is. Thankyou.
Hi Ciao
Thank you for your reply. I have tried the code, which works fine, but i need it to perform the auto sum from any selected row in column D and only sum up to a blank line and not to D2. Hope you can help me.
Hi, Stratfordoaks,
there was no blank cell in Column D in your sample?
You may utilze something like
but you need to check if the returned value is greater than 1 (which would mean no empty cells in that column).Please Login or Register to view this content.
Ciao, '<-- Greeting
Holger '<-- FirstName
Hi Holger
Sorry for wrong name! Please excuse my newness to macro's. Could you give me the code for doing this autosum including your code in the last reply?
Hi, Stratfordoaks,
no problem with my name. Please find the altered code, changes are coloured in blue:
Ciao,Please Login or Register to view this content.
Holger
Hi Holger
Its almost perfect! It auto sums upwards from whichever row I start from in column D, but does not sum the last row at the top of the range. For example if I start in cell D11 the formula shows =SUM($D$8:$D$10) and I need it to be =SUM($D$7:$D$10) as the data is in rows D7:D10. Thank you for your help.
Hi, Stratfordoaks,
please change the red lines
to read eitherPlease Login or Register to view this content.
which switches the lines into comments the compiler will not regard when running or shorten the code by deleting them toPlease Login or Register to view this content.
Ciao,Please Login or Register to view this content.
Holger
Hi Holger
That works perfectly now. Thank you so much for your help
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks