ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Application-defined or object-defined error (https://www.excelbanter.com/excel-programming/427696-application-defined-object-defined-error.html)

Ayo

Application-defined or object-defined error
 
I am getting the above error message on the code line below and I can't
figure it out. MScell is a string variable that evaluates to "J".
I would appreciate any insight into this.
Thanks.
Me.Range("H6").Formula =
"=IF(TODAY()=$B6,SUMPRODUCT(--(Actualized!$B$16:$B$1056=$B$3),--(Actualized!$" & MScell & "$16:$" & MScell & "$1056<=$B6)),"")"


Jacob Skaria

Application-defined or object-defined error
 
Replace the double quotes to denote blank within the formula ("") with """"

as below

Me.Range("H6").Formula =
"=IF(TODAY()=$B6,SUMPRODUCT(--(Actualized!$B$16:$B$1056=$B$3),--(Actualized!$" & MScell & "$16:$" & MScell & "$1056<=$B6)),"""")"

--
If this post helps click Yes
---------------
Jacob Skaria


"Ayo" wrote:

I am getting the above error message on the code line below and I can't
figure it out. MScell is a string variable that evaluates to "J".
I would appreciate any insight into this.
Thanks.
Me.Range("H6").Formula =
"=IF(TODAY()=$B6,SUMPRODUCT(--(Actualized!$B$16:$B$1056=$B$3),--(Actualized!$" & MScell & "$16:$" & MScell & "$1056<=$B6)),"")"


Ayo

Application-defined or object-defined error
 
Thanks Jacob. It worked.

"Jacob Skaria" wrote:

Replace the double quotes to denote blank within the formula ("") with """"

as below

Me.Range("H6").Formula =
"=IF(TODAY()=$B6,SUMPRODUCT(--(Actualized!$B$16:$B$1056=$B$3),--(Actualized!$" & MScell & "$16:$" & MScell & "$1056<=$B6)),"""")"

--
If this post helps click Yes
---------------
Jacob Skaria


"Ayo" wrote:

I am getting the above error message on the code line below and I can't
figure it out. MScell is a string variable that evaluates to "J".
I would appreciate any insight into this.
Thanks.
Me.Range("H6").Formula =
"=IF(TODAY()=$B6,SUMPRODUCT(--(Actualized!$B$16:$B$1056=$B$3),--(Actualized!$" & MScell & "$16:$" & MScell & "$1056<=$B6)),"")"



All times are GMT +1. The time now is 01:27 PM.

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