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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
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,226,730
Messages
6,192,708
Members
453,748
Latest member
akhtarf3

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