Can't add "=" before Cells.Value equation [VBA] 1004 Error

benbreaker2000

New Member
Joined
Mar 25, 2019
Messages
1
I have a dynamic equation that is filling across multiple cells, so until the equation is completely generate, I have not included the "=" sign at the beginning. I thought adding it would be as simple as Cells(i,j).Value = "=" & Cells.Value, but this does not work. I have tried the same thing similarly with Range.Value, Cell.Formula, and Range.Formula. It always returns a Runtime Error 1004, Application/ Object-Defined Error. Does anyone have any creative solutions for taking the cell value and adding a "=" to convert it to an equation?
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
What happens with
Code:
Cells(i,j).[COLOR="#FF0000"]Formula[/COLOR]
rather than
Code:
Cells(i,j).Value
 
Upvote 0
Welcome to the forum.

Can you give an example of the exact contents of a cell that fails?
 
Upvote 0
Try :
Code:
Cells(i,j).Formula = "=" & Cells(i,j).Text
I have tested this with a simple formula. The formula I used read: sum(D2:D15)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,899
Messages
6,122,155
Members
449,068
Latest member
shiz11713

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