NessPJ
Active Member
- Joined
- May 10, 2011
- Messages
- 422
- Office Version
- 365
Hello all,
I'm trying to enter 2 formulas in a range of cells in my VBA routine but i keep getting Debug errors upon execution (Run-time error 1004: Application defined or Object defined error).
These are the lines of VBA i am trying to use:
I can paste both formulas into a cell and they will work fine. Am i using some wrong syntax somewhere?
I'm trying to enter 2 formulas in a range of cells in my VBA routine but i keep getting Debug errors upon execution (Run-time error 1004: Application defined or Object defined error).
These are the lines of VBA i am trying to use:
Code:
Range("K2").Formula = "=TIME(IF(Roundup(L2*24;0)+3>=24;23;Roundup(L2*24;0)+3);0;0)"
Range("I2").Formula = "=IF((HOUR(L2)+24)-(HOUR(K2)-1)>=Par!$B$32;30;(HOUR(L2)+24)-(HOUR(K2)-1))"
I can paste both formulas into a cell and they will work fine. Am i using some wrong syntax somewhere?