Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Copy Formula Code

Can anyone please give me a code that copies the preceeding cell and inserts
the formula only into the selected cell?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy Formula Code


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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Copy Formula Code

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" wrote in message
...
Can anyone please give me a code that copies the preceeding cell and
inserts
the formula only into the selected cell?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Copy Formula Code

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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Copy Formula Code

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" wrote in message
...
Can anyone please give me a code that copies the preceeding cell and
inserts
the formula only into the selected cell?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to Copy a Formula to Multiple Sheets Q Seanie Excel Programming 2 November 5th 08 04:06 PM
copy formula using VB code ASU Excel Discussion (Misc queries) 2 September 7th 06 09:09 PM
copy and paste formula using vb code ASU Excel Discussion (Misc queries) 4 September 7th 06 08:56 PM
Code to copy formula to variable range Snowsride Excel Programming 4 November 3rd 05 09:41 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM


All times are GMT +1. The time now is 04:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"