|First a posting tip:|
First, when posting in a Help forum such as this, please try to use a Subject Line that tells us something about your question. If everyone used a generic Subject Line such as "Why does this not work?" or "I Need Help", we wouldn't be able to tell one question from another and the Archives would essentially be useless.
As moderator of this forum, I have editied the subject line of your post to reflect what your question is about. If you would take a look at some of the other subject lines used for questions in this forum, you should be able to get a feel for what a "relevant subject line" looks like. Thanks!
As for your question, let's just make sure we have the terminology correct. What you referred to as a "formula" is actually called a "macro". A formula resides in a worksheet cell, while a macro resides in a VBA module within a workbook.
That said, based on the screen shot I see in your post, it looks to me as if one line has been split into two.
While this line is a valid VBA instruction...
Range("A1").Value = Range("A1").Value
...this line, by itself, is not, and therefore presents the error message:
While the instruction referencing A1 is valid and VBA will process it, it really doesn't do anything except set A1 equal to itself, basically changing nothing. However, look at what happens when we combine those 2 lines into a single instruction:
Range("A1").Value = Range("A1").Value + Range("B1").Value
We are telling VBA to add the value in B1 to the value in A1 and store the result in A1.
There are 2 ways that an instruction like that can be written. It can be written as single line as shown above, or it can be split in two if the "continuation character" (an underscore) is used. If we use the continuation character, it would look like this, and VBA would read it as a single line.
Range("A1").Value = Range("A1").Value _
Note the space before the underscore. That space is required in order for VBA to recognize the underscore as the continuation character.
I hope that resolves your issue.
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.