Write formula in Macro

bulke

New Member
Joined
Jun 20, 2011
Messages
1
dear all,

I have a very heavy file with formula across several sheets (linked). I want to insert the formulas which are in a large area into a macro.

How can I insert a formula which will look for data in another sheet and sum them in another.
EX:
There is one sheet per employee which insert their daily task, the task are then compute per hour in another sheet. The weekly total is then computed in another sheet for all employees.
How can I write the formula which will look for the total of tasks per employee: it looks like
=if(iserror(countif(sheet1A1:A5,B1)/sumproduct(countif(sheet1A1:A5,LISTOFACTIVITIES))/1440*,"",countif(sheet1A1:A5,B1)/sumproduct(countif(sheet1A1:A5,LISTOFACTIVITIES))/1440*)

I think I am being pretty vague with giving the above formula...
but if someone could give some tips on how to write a similar formula in a macro for a given range of cell...

Looking forward to your answer.

Cheers

Bulke
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
select the cell for the formula in the code and do

activecell.formula = "=formula"

or you can do

activecell.formulaR1C1 which is Row/Column
 
Upvote 0

Forum statistics

Threads
1,224,525
Messages
6,179,319
Members
452,905
Latest member
deadwings

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top