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?
 

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
13,323
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
What happens with
Code:
Cells(i,j).[COLOR="#FF0000"]Formula[/COLOR]
rather than
Code:
Cells(i,j).Value
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
35,487
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
Welcome to the forum.

Can you give an example of the exact contents of a cell that fails?
 

jmacleary

Well-known Member
Joined
Oct 5, 2015
Messages
1,023
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
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:

Watch MrExcel Video

Forum statistics

Threads
1,108,624
Messages
5,523,968
Members
409,547
Latest member
AW2020

This Week's Hot Topics

Top