Question : VBA to add formula with relative reference as opposed to absolute.

Hi Experts

The following line of code returns an absolute reference to the second part of the sum.

Range("E120").Formula = "=(E114 + " & Range("E2000").End(xlUp).Address & ")"

so in E120, I'm getting   =(E114 + $E$171), but I really want =(E114 + E171), as I need to autofill later on.

Please can anybody advise how to change this.

Many thanks.

Nick.

Answer : VBA to add formula with relative reference as opposed to absolute.

Here is the proper way to do it...

Range("E120").Formula = "=(E114 + " & Range("E2000").End(xlUp).Address(False, False) & ")"

:-)
Albert

Random Solutions  
 
programming4us programming4us