Solved

# copy paste formula vba

Posted on 2011-10-20
172 Views
Hi Guys,

I am trying to copy paste a formula down to a certain row.
=MAX(U2:\$U\$2)-U2

When I use copy/paste.formula,  the exact formula gets copied... (not incrementing the U2 - without the \$)

When I use Range.formulaR1C1
the formula changes to
=MAX(U\$2:\$U3)-U3

Any idea how to make the second copy =MAX(U3:\$U\$2)-U3
so on and so on??

thansk!!!
0
Question by:solarissf

LVL 33

Accepted Solution

When you copy this:

=MAX(U2:\$U\$2)-U2

Say from cell B2 and paste it on cell B5 for instance, you will get this:

=MAX(U\$2:\$U5)-U5

the first U2 changed his position to the end of the range definition so instead of  U5:U\$2, wich doesn't make sense, you will get U\$2:\$U5 because the smallest part of the range will be on the beggining and the biggest on the end.

Hope you understand what I'm trying to say to you.

jppinto
0

Author Comment

pardon my stupidity, my fault

thanks!!!
0

## Featured Post

Sometimes we don't want to show zeros in our Excel spreadsheets. This is sometimes most evident in our charts. Look at the chart below, all the zero values are visible. I think that all will agree with the fact that zero values are not looking nice …
What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.