Question : reference own cell in excel

Hi experts
Lets say I have two cells F5 and G5, I want to increment G5 with the number in F5, I keep getting a circular referencing error when I try to do this. Can someone tell me how this can be achieved

Answer : reference own cell in excel


=SUM(F5+G5) is a bit of an odd construct. Either do =Sum(F5:G5) or do =F5+G5. You don't need to wrap a Sum() around a simple addition.

dizzycat: If you want to add the value of F5 to G5 and display the result in G5, then you will need a macro.

Copy the code below, then right click the sheet tab, select "View Code" and paste the code into the code window.

cheers, teylyn
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [F5]) Is Nothing Then
    [G5] = [G5] + [F5]
End If
End Sub
Random Solutions  
programming4us programming4us