-1

i have a simple question but i can't find an answer in google.

i have the following simple code:

cells(1,1)= cells(1,2) + cells(1,3)

i want to be able to show the user the result in cells(1,1) but that he can also see how i got it (if he stands on the cell he should see that i did =B1+C1). how can i do it?

moreover, i want him to be able to change the numbers in B1,C1 and get a new result in A1 like regular he could do in regular excel function how can i do it?

thanks!

Tim Williams
  • 154,628
  • 8
  • 97
  • 125
oded
  • 11
  • 1
    A formula would do exactly what you want so why not use one? If you *really* want to do this with VBA then you can look at the worksheet_change event. – Tim Williams Jan 22 '21 at 17:06

1 Answers1

0

I think you may want to just add a formula to the cell and not put in a value.

Check this out. VBA To Add Formula To Cell

Not exactly what you are asking but it shows you how to add a formula in your vba code.

Ty Lamb
  • 11
  • 3