PC Review


Reply
Thread Tools Rate Thread

Copy Formula Code

 
 
Nikki
Guest
Posts: n/a
 
      31st Dec 2008
Can anyone please give me a code that copies the preceeding cell and inserts
the formula only into the selected cell?
 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      31st Dec 2008
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

--
Rick (MVP - Excel)


"Nikki" <(E-Mail Removed)> wrote in message
news:869AEBD6-ED65-4642-8DBB-(E-Mail Removed)...
> Can anyone please give me a code that copies the preceeding cell and
> inserts
> the formula only into the selected cell?


 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      31st Dec 2008
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.

"JBeaucaire" wrote:

>
> Define "preceding cell". Give specific examples of source and target
> cells.
>
>
> --
> JBeaucaire
> ------------------------------------------------------------------------
> JBeaucaire's Profile: http://www.thecodecage.com/forumz/member.php?userid=73
> View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=45556
>
>

 
Reply With Quote
 
Nikki
Guest
Posts: n/a
 
      2nd Jan 2009
THis worked Thanks a bunch



"Rick Rothstein" wrote:

> 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
>
> --
> Rick (MVP - Excel)
>
>
> "Nikki" <(E-Mail Removed)> wrote in message
> news:869AEBD6-ED65-4642-8DBB-(E-Mail Removed)...
> > Can anyone please give me a code that copies the preceeding cell and
> > inserts
> > the formula only into the selected cell?

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to Copy a Formula to Multiple Sheets Q Seanie Microsoft Excel Programming 2 5th Nov 2008 04:06 PM
copy formula using VB code =?Utf-8?B?QVNV?= Microsoft Excel Misc 2 7th Sep 2006 09:09 PM
copy and paste formula using vb code =?Utf-8?B?QVNV?= Microsoft Excel Misc 4 7th Sep 2006 08:56 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values =?Utf-8?B?RGVubmlz?= Microsoft Excel Misc 10 2nd Mar 2006 10:47 PM
Code to copy formula to variable range =?Utf-8?B?U25vd3NyaWRl?= Microsoft Excel Programming 4 3rd Nov 2005 09:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:17 AM.