Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
ArthurJ
 
Posts: n/a
Default Copying a formula "literally"

Say I have the following relative reference formulas in Col A:
+D1
+D2
+D3

I want exactly the same formulas in Col B:
+D1
+D2
+D3

I can change the formulas in Col A to absolute reference, copy/paste them,
and then change all formulas back to relative. Along similar lines I could
add an apostrophe in front of each formula before copying it, thereby
changing it to text, then removing it after the copy/paste.

But these methods are manual and cell by cell.

Is there a quicker way to do this, short of writing VBA code?

Art
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Copying a formula "literally"

"ArthurJ" wrote:
.. I have the following relative reference formulas in Col A:
+D1
+D2
+D3


I want exactly the same formulas in Col B:
+D1
+D2
+D3

....
Not a direct answer probably,
but on the face of it, why not just point col B to col A ?
eg: in B1: = A1, with B1 copied down
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #3   Report Post  
Posted to microsoft.public.excel.misc
JMB
 
Posts: n/a
Default Copying a formula "literally"

In column B, enter the first formula

=D1

Then, select the cell w/this formula, put your mouse on the little black
cross in the bottom right corner, click and hold the left mouse button while
you drag the formula down as far as you need.

"ArthurJ" wrote:

Say I have the following relative reference formulas in Col A:
+D1
+D2
+D3

I want exactly the same formulas in Col B:
+D1
+D2
+D3

I can change the formulas in Col A to absolute reference, copy/paste them,
and then change all formulas back to relative. Along similar lines I could
add an apostrophe in front of each formula before copying it, thereby
changing it to text, then removing it after the copy/paste.

But these methods are manual and cell by cell.

Is there a quicker way to do this, short of writing VBA code?

Art

  #4   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Copying a formula "literally"

Perhaps more directly to your subject line ..

In the source sheet,

Select the range of formula cells
Click Edit Replace
Find: =
Replace with: zzzzz (say)
Click Replace All

Then select the range copy

and in the destination sheet,

Right-click Paste
Click Edit Replace
Find: zzzzz
Replace with: =
Click Replace All

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #5   Report Post  
Posted to microsoft.public.excel.misc
Dana DeLouis
 
Posts: n/a
Default Copying a formula "literally"

Copying a formula "literally"

Hi. Any copy operation puts Excel into CutCopyMode, and will adjust the
references.
As one alternative, see if this macro will work for you.

Sub Demo()
Columns(2).Formula = Columns(1).Formula
End Sub

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"ArthurJ" wrote in message
...
Say I have the following relative reference formulas in Col A:
+D1
+D2
+D3

I want exactly the same formulas in Col B:
+D1
+D2
+D3

I can change the formulas in Col A to absolute reference, copy/paste them,
and then change all formulas back to relative. Along similar lines I could
add an apostrophe in front of each formula before copying it, thereby
changing it to text, then removing it after the copy/paste.

But these methods are manual and cell by cell.

Is there a quicker way to do this, short of writing VBA code?

Art





  #6   Report Post  
Posted to microsoft.public.excel.misc
JBarr
 
Posts: n/a
Default Copying a formula "literally"

Max,

If you place a $ in front of the column reference (i.e. +$D1), it will
always keep your cell reference on column D. The same thing applies to
rows if you place a $ in front of the row reference (i.e. +D$1). You
can also have a static cell reference by placing a $ in front of both
the column and row reference (i.e. +$D$1). In addition, you can copy
the cells with the formula you need and Paste Special -- Formulas
where you want the new formulas.

I hope that helps!

Jan

  #7   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Copying a formula "literally"

ArthurJ, you mean <g
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #8   Report Post  
Posted to microsoft.public.excel.misc
gjcase
 
Posts: n/a
Default Copying a formula "literally"


If you want the exact copy vs relative, simply place an apostrophe (')
ahead of the equals sign in the first formula, similar to adding
comments in some programming languages; this changes it from a formula
to text. Then copy it to the new cell, then remove the apostrophes from
both.

Incidentally, this works pretty well if you are trying to debug a long
formula and Excel won't let you enter the formula with a mistake in it.
You can "comment out" the entire formula, then copy it and work on
pices of the formula until you find the fix.


--
gjcase
------------------------------------------------------------------------
gjcase's Profile: http://www.excelforum.com/member.php...o&userid=26061
View this thread: http://www.excelforum.com/showthread...hreadid=509176

  #9   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Copying a formula "literally"

I wouldn't use an apostrophe. Those are very difficult to clean up with
Edit|replace's.

I'd use:

edit|replace
what: = (equal sign)
with: $$$$$=
replace all.

That unique string $$$$$= should be easy to change back to a single equal sign.

gjcase wrote:

If you want the exact copy vs relative, simply place an apostrophe (')
ahead of the equals sign in the first formula, similar to adding
comments in some programming languages; this changes it from a formula
to text. Then copy it to the new cell, then remove the apostrophes from
both.

Incidentally, this works pretty well if you are trying to debug a long
formula and Excel won't let you enter the formula with a mistake in it.
You can "comment out" the entire formula, then copy it and work on
pices of the formula until you find the fix.

--
gjcase
------------------------------------------------------------------------
gjcase's Profile: http://www.excelforum.com/member.php...o&userid=26061
View this thread: http://www.excelforum.com/showthread...hreadid=509176


--

Dave Peterson
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
Copying a formula to multiple worksheets RobHan Excel Worksheet Functions 1 February 16th 06 05:21 PM
Returned: Copying a formula horizontally, the source data is verti Shannon Excel Discussion (Misc queries) 5 December 21st 05 10:27 PM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
How do I prevent a formula element from incrementing when copying Copying Excel Formulas Excel Worksheet Functions 3 September 8th 05 05:15 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM


All times are GMT +1. The time now is 02:49 AM.

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

About Us

"It's about Microsoft Excel"