ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   @Sum Conditional Values within a Macro (https://www.excelbanter.com/excel-discussion-misc-queries/260703-%40sum-conditional-values-within-macro.html)

Jocko_MacDuff116

@Sum Conditional Values within a Macro
 
I created a Macro which

I am trying to create a macro which repeats the following steps

macro inputs value in C3 (values 1 thru 24)
each value entered changes the value in cell C5
enter the value in C5 in Col D rows 1 thru 24

MY MACRO INCLUDES

Step 1
GOTO cell D1
Highlight cells D1 to D24 and delete values (delete any old
values) in Col D)

Step 2
GOTO cell C3
enter value 1 (an integer)
GOTO cell D1 @if(C3=1, C5, D1) (a formula)

Step 3
GOTO cell C3
enter value 2 (an interger)

goto cell D2 @if(C3=2, C5, D2), (a formula)

repeat the above step for all values from 3 to 24
place resulting value from C5 in cells D3 to D24
UP TO HERE THE MACRO WORKS

then
GOTO cell D25
enter formula @sum(D1.D24)
THIS PART DOESNT WORK IT SHOWS THE TOTAL AS 0.00

Any suggestions?



Per Jessen

@Sum Conditional Values within a Macro
 
As always, show us your macro for comments.

Regards,
Per

"Jocko_MacDuff116" skrev i
meddelelsen ...
I created a Macro which

I am trying to create a macro which repeats the following steps

macro inputs value in C3 (values 1 thru 24)
each value entered changes the value in cell C5
enter the value in C5 in Col D rows 1 thru 24

MY MACRO INCLUDES

Step 1
GOTO cell D1
Highlight cells D1 to D24 and delete values (delete any old
values) in Col D)

Step 2
GOTO cell C3
enter value 1 (an integer)
GOTO cell D1 @if(C3=1, C5, D1) (a formula)

Step 3
GOTO cell C3
enter value 2 (an interger)

goto cell D2 @if(C3=2, C5, D2), (a formula)

repeat the above step for all values from 3 to 24
place resulting value from C5 in cells D3 to D24
UP TO HERE THE MACRO WORKS

then
GOTO cell D25
enter formula @sum(D1.D24)
THIS PART DOESNT WORK IT SHOWS THE TOTAL AS 0.00

Any suggestions?




All times are GMT +1. The time now is 07:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com