Copy Formula Code

N

Nikki

Can anyone please give me a code that copies the preceeding cell and inserts
the formula only into the selected cell?
 
R

Rick Rothstein

Did you want an identical copy of the formula (same range references)...

Selection.Formula = Selection.Offset(, -1).Formula

Or did you want the range reference to update for their new location...

Selection.Offset(, -1).Copy Selection
 
J

JLGWhiz

Some people do not realize that this site is visited by users from many
different countries and that some read from right to left and some read
vertically. Even worse, preceding could infer the previously selected cell
which could be anywhere. But the OP probably means the one to immediately to
the left of the selection.
 
N

Nikki

THis worked Thanks a bunch



Rick Rothstein said:
Did you want an identical copy of the formula (same range references)...

Selection.Formula = Selection.Offset(, -1).Formula

Or did you want the range reference to update for their new location...

Selection.Offset(, -1).Copy Selection
 
Top