VBA - sum a column based on date









up vote
-3
down vote

favorite












I'm looking to use a VBA to sum a specified column in my workbook based on the date listed in column A. So, for example if the date in column A is 05/09/2018, it will provide a sum total of the values recorded in column L on that date and put that sum total figure in a cell in column M. I've attached a screenshot of my table columns below, any help would be appreciated as I am still learning VBA. Thank you!



enter image description here










share|improve this question



















  • 2




    Why do you want to do it using vba? You can use SUMIF function to do that.
    – Pavel_V
    yesterday










  • Hi, i understand it would be fairly simple to do using a SUMIF however the team i am working on this workbook with have suggested having that process automated.
    – NHure92
    yesterday






  • 1




    The sumif equivalent exists in vba, but why complicate with vba - if someone turns off macros then it will stop working....
    – Solar Mike
    yesterday










  • I am not sure what kind of automation you think can be achieved via vba in this that cant be done using the SUMIF function. If you setup the function it will "automatically" calculate the result if you change the input cells. In VBA you can either create UDF to handle this which will do totally the same thing or you can create a macro that needs to be either manually run or run based on some event/trigger, which is kind of equally or less automatic than a function.
    – Pavel_V
    yesterday











  • Possible duplicate of Error when using SUMIFS from different worksheet
    – OwlsSleeping
    yesterday














up vote
-3
down vote

favorite












I'm looking to use a VBA to sum a specified column in my workbook based on the date listed in column A. So, for example if the date in column A is 05/09/2018, it will provide a sum total of the values recorded in column L on that date and put that sum total figure in a cell in column M. I've attached a screenshot of my table columns below, any help would be appreciated as I am still learning VBA. Thank you!



enter image description here










share|improve this question



















  • 2




    Why do you want to do it using vba? You can use SUMIF function to do that.
    – Pavel_V
    yesterday










  • Hi, i understand it would be fairly simple to do using a SUMIF however the team i am working on this workbook with have suggested having that process automated.
    – NHure92
    yesterday






  • 1




    The sumif equivalent exists in vba, but why complicate with vba - if someone turns off macros then it will stop working....
    – Solar Mike
    yesterday










  • I am not sure what kind of automation you think can be achieved via vba in this that cant be done using the SUMIF function. If you setup the function it will "automatically" calculate the result if you change the input cells. In VBA you can either create UDF to handle this which will do totally the same thing or you can create a macro that needs to be either manually run or run based on some event/trigger, which is kind of equally or less automatic than a function.
    – Pavel_V
    yesterday











  • Possible duplicate of Error when using SUMIFS from different worksheet
    – OwlsSleeping
    yesterday












up vote
-3
down vote

favorite









up vote
-3
down vote

favorite











I'm looking to use a VBA to sum a specified column in my workbook based on the date listed in column A. So, for example if the date in column A is 05/09/2018, it will provide a sum total of the values recorded in column L on that date and put that sum total figure in a cell in column M. I've attached a screenshot of my table columns below, any help would be appreciated as I am still learning VBA. Thank you!



enter image description here










share|improve this question















I'm looking to use a VBA to sum a specified column in my workbook based on the date listed in column A. So, for example if the date in column A is 05/09/2018, it will provide a sum total of the values recorded in column L on that date and put that sum total figure in a cell in column M. I've attached a screenshot of my table columns below, any help would be appreciated as I am still learning VBA. Thank you!



enter image description here







excel vba






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Cindy Meister

12.9k101934




12.9k101934










asked yesterday









NHure92

376




376







  • 2




    Why do you want to do it using vba? You can use SUMIF function to do that.
    – Pavel_V
    yesterday










  • Hi, i understand it would be fairly simple to do using a SUMIF however the team i am working on this workbook with have suggested having that process automated.
    – NHure92
    yesterday






  • 1




    The sumif equivalent exists in vba, but why complicate with vba - if someone turns off macros then it will stop working....
    – Solar Mike
    yesterday










  • I am not sure what kind of automation you think can be achieved via vba in this that cant be done using the SUMIF function. If you setup the function it will "automatically" calculate the result if you change the input cells. In VBA you can either create UDF to handle this which will do totally the same thing or you can create a macro that needs to be either manually run or run based on some event/trigger, which is kind of equally or less automatic than a function.
    – Pavel_V
    yesterday











  • Possible duplicate of Error when using SUMIFS from different worksheet
    – OwlsSleeping
    yesterday












  • 2




    Why do you want to do it using vba? You can use SUMIF function to do that.
    – Pavel_V
    yesterday










  • Hi, i understand it would be fairly simple to do using a SUMIF however the team i am working on this workbook with have suggested having that process automated.
    – NHure92
    yesterday






  • 1




    The sumif equivalent exists in vba, but why complicate with vba - if someone turns off macros then it will stop working....
    – Solar Mike
    yesterday










  • I am not sure what kind of automation you think can be achieved via vba in this that cant be done using the SUMIF function. If you setup the function it will "automatically" calculate the result if you change the input cells. In VBA you can either create UDF to handle this which will do totally the same thing or you can create a macro that needs to be either manually run or run based on some event/trigger, which is kind of equally or less automatic than a function.
    – Pavel_V
    yesterday











  • Possible duplicate of Error when using SUMIFS from different worksheet
    – OwlsSleeping
    yesterday







2




2




Why do you want to do it using vba? You can use SUMIF function to do that.
– Pavel_V
yesterday




Why do you want to do it using vba? You can use SUMIF function to do that.
– Pavel_V
yesterday












Hi, i understand it would be fairly simple to do using a SUMIF however the team i am working on this workbook with have suggested having that process automated.
– NHure92
yesterday




Hi, i understand it would be fairly simple to do using a SUMIF however the team i am working on this workbook with have suggested having that process automated.
– NHure92
yesterday




1




1




The sumif equivalent exists in vba, but why complicate with vba - if someone turns off macros then it will stop working....
– Solar Mike
yesterday




The sumif equivalent exists in vba, but why complicate with vba - if someone turns off macros then it will stop working....
– Solar Mike
yesterday












I am not sure what kind of automation you think can be achieved via vba in this that cant be done using the SUMIF function. If you setup the function it will "automatically" calculate the result if you change the input cells. In VBA you can either create UDF to handle this which will do totally the same thing or you can create a macro that needs to be either manually run or run based on some event/trigger, which is kind of equally or less automatic than a function.
– Pavel_V
yesterday





I am not sure what kind of automation you think can be achieved via vba in this that cant be done using the SUMIF function. If you setup the function it will "automatically" calculate the result if you change the input cells. In VBA you can either create UDF to handle this which will do totally the same thing or you can create a macro that needs to be either manually run or run based on some event/trigger, which is kind of equally or less automatic than a function.
– Pavel_V
yesterday













Possible duplicate of Error when using SUMIFS from different worksheet
– OwlsSleeping
yesterday




Possible duplicate of Error when using SUMIFS from different worksheet
– OwlsSleeping
yesterday

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53222158%2fvba-sum-a-column-based-on-date%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53222158%2fvba-sum-a-column-based-on-date%23new-answer', 'question_page');

);

Post as a guest














































































這個網誌中的熱門文章

How to combine Bézier curves to a surface?

Carbon dioxide

Why am i infinitely getting the same tweet with the Twitter Search API?