Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default copying 3D reference from one file to another

I have a file called Book1. In cell C1 on Sheet2 there is an equation that
reads:

=Sheet1!A1+10

I have another file called Book2. When I copy the above equation into cell
C1 on Sheet2 of Book2, it pastes in the following:

=[Book2]Sheet1!A1+10

So Excel wants to make a reference back to Sheet1!A1 in the original file.

I want to copy the equation over to the new book, but just have it make
reference to Sheet1!A1 in the new book, not back to the original file. It
seems like the reference to the sheet is absolute by default, but I want it
to be relative.

Is there a way to get Excel to copy a sheet reference from one file to
another without making reference back to the original file?

Thanks for any help.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default Correction

Pardon me, there was a typo in the way I phrased the original question. Here
is the update:

I have a file called Book1. In cell C1 on Sheet2 there is an equation that
reads:

=Sheet1!A1+10

I have another file called Book2. When I copy the above equation into cell
C1 on Sheet2 of Book2, it pastes in the following:

=[Book1]Sheet1!A1+10

So Excel wants to make a reference back to Sheet1!A1 in the original file.

I want to copy the equation over to the new book, but just have it make
reference to Sheet1!A1 in the new book, not back to the original file. It
seems like the reference to the sheet is absolute by default, but I want it
to be relative.

Is there a way to get Excel to copy a sheet reference from one file to
another without making reference back to the original file?

Thanks for any help.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Correction

Try this macro:

Sub formulaize()
Dim r As Range
Dim wb1 As Workbook
Dim wb2 As Workbook

Set wb1 = Workbooks("Book1.xls")
Set wb2 = Workbooks("Book2.xls")

wb1.Activate
Sheets("Sheet2").Activate
MsgBox (" ")
Dim s As String
For Each r In ActiveSheet.UsedRange
If r.HasFormula Then
addy = r.Address
s = r.Formula
wb2.Sheets("Sheet2").Range(addy).Formula = s
End If
Next
End Sub

--
Gary''s Student - gsnu200906


"Eric" wrote:

Pardon me, there was a typo in the way I phrased the original question. Here
is the update:

I have a file called Book1. In cell C1 on Sheet2 there is an equation that
reads:

=Sheet1!A1+10

I have another file called Book2. When I copy the above equation into cell
C1 on Sheet2 of Book2, it pastes in the following:

=[Book1]Sheet1!A1+10

So Excel wants to make a reference back to Sheet1!A1 in the original file.

I want to copy the equation over to the new book, but just have it make
reference to Sheet1!A1 in the new book, not back to the original file. It
seems like the reference to the sheet is absolute by default, but I want it
to be relative.

Is there a way to get Excel to copy a sheet reference from one file to
another without making reference back to the original file?

Thanks for any help.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default Correction

Thanks for the help. I was hoping there was an Options setting change I could
use to change how Excel copies sheet references from one file to another. Is
a macro the only way to handle this?

Thanks - Eric

"Gary''s Student" wrote:

Try this macro:

Sub formulaize()
Dim r As Range
Dim wb1 As Workbook
Dim wb2 As Workbook

Set wb1 = Workbooks("Book1.xls")
Set wb2 = Workbooks("Book2.xls")

wb1.Activate
Sheets("Sheet2").Activate
MsgBox (" ")
Dim s As String
For Each r In ActiveSheet.UsedRange
If r.HasFormula Then
addy = r.Address
s = r.Formula
wb2.Sheets("Sheet2").Range(addy).Formula = s
End If
Next
End Sub

--
Gary''s Student - gsnu200906


"Eric" wrote:

Pardon me, there was a typo in the way I phrased the original question. Here
is the update:

I have a file called Book1. In cell C1 on Sheet2 there is an equation that
reads:

=Sheet1!A1+10

I have another file called Book2. When I copy the above equation into cell
C1 on Sheet2 of Book2, it pastes in the following:

=[Book1]Sheet1!A1+10

So Excel wants to make a reference back to Sheet1!A1 in the original file.

I want to copy the equation over to the new book, but just have it make
reference to Sheet1!A1 in the new book, not back to the original file. It
seems like the reference to the sheet is absolute by default, but I want it
to be relative.

Is there a way to get Excel to copy a sheet reference from one file to
another without making reference back to the original file?

Thanks for any help.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default copying 3D reference from one file to another

One way............

Copy the formula directly from the formula bar.

Paste that to new workbook.

Another way for multiple formulas..................

EditReplace

What: =

With: ^^^

Replace all

Copy and paste then reverse the editreplace.


Gord Dibben MS Excel MVP

On Mon, 5 Oct 2009 12:58:02 -0700, Eric
wrote:

I have a file called Book1. In cell C1 on Sheet2 there is an equation that
reads:

=Sheet1!A1+10

I have another file called Book2. When I copy the above equation into cell
C1 on Sheet2 of Book2, it pastes in the following:

=[Book2]Sheet1!A1+10

So Excel wants to make a reference back to Sheet1!A1 in the original file.

I want to copy the equation over to the new book, but just have it make
reference to Sheet1!A1 in the new book, not back to the original file. It
seems like the reference to the sheet is absolute by default, but I want it
to be relative.

Is there a way to get Excel to copy a sheet reference from one file to
another without making reference back to the original file?

Thanks for any help.


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 relative reference across worksheets MrPhysics Excel Discussion (Misc queries) 2 April 1st 09 08:43 PM
copying a column reference into a row lars1028 Excel Discussion (Misc queries) 4 June 26th 06 10:17 PM
copying a reference jrw Excel Worksheet Functions 1 April 12th 06 05:32 PM
Copying a mixed reference formula Sarah Excel Discussion (Misc queries) 6 January 13th 05 09:45 PM
copying a formula, the reference adjusts, but the result does not chezoo Excel Discussion (Misc queries) 1 January 12th 05 01:51 AM


All times are GMT +1. The time now is 04:45 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"