Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Copy/Paste Formulas Without Linking Books

How do I copy formulas which read from several sheets within a workbook into
another workbook? Currently, as I copy from one book to another, Excel wants
to link the two books. The books have identical sheet names/page design.

Example:
Copy from:
MyFile.xls cell A1 formula
=Jan!C5+Feb!C5+Mar!C5+Apr!C5

Paste to:
Newfile.xls Cell A1 becomes
='[MyFile.xls]Jan'!C5+'[MyFile.xls]Feb'!C5+'[MyFile.xls]Mar'!C5+'[MyFile.xls]Apr'!C5

Can I copy without linking?

Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Copy/Paste Formulas Without Linking Books

I think you are looking for something like:

Workbooks("MyFile").Sheets(???).Range("A1").copy _
Destination:=Workbooks("Newfile").Sheets(???).Rang e("A1")

You can make this more generic:

===================
Sub xfer()
Dim rw As Integer, col As Integer, wksh As Integer

For wksh = 1 To Workbooks("MyFile").Worksheets.Count ' cycle through all
worksheets
For rw = 1 To
Workbooks("MyFile").Sheets(wksh).Cells.SpecialCell s(xlLastCell).Row '
cycle through all used rows
For col = 1 To
Workbooks("MyFile").Sheets(wksh).Cells.SpecialCell s(xlLastCell).Column '
cycle through all used columns
If Len(Workbooks("MyFile").Sheets(wksh).Cells(rw, col)) 0
Then ' ignor empty cells
Workbooks("NewFile").Sheets(wksh).Cells(rw, col).FormulaR1C1
= Workbooks("MyFile").Sheets(wksh).Cells(rw, col).FormulaR1C1
End If
Next
Next
Next

End Sub
========================


You should turn off screenupdating and calculation at the beginning and turn
them back on at the end.

Note that there is no select or activate.

rand451

"TOMB" wrote in message
...
How do I copy formulas which read from several sheets within a workbook
into
another workbook? Currently, as I copy from one book to another, Excel
wants
to link the two books. The books have identical sheet names/page design.

Example:
Copy from:
MyFile.xls cell A1 formula
=Jan!C5+Feb!C5+Mar!C5+Apr!C5

Paste to:
Newfile.xls Cell A1 becomes:
='[MyFile.xls]Jan'!C5+'[MyFile.xls]Feb'!C5+'[MyFile.xls]Mar'!C5+'[MyFile.xls]Apr'!C5

Can I copy without linking?

Thanks in advance!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Copy/Paste Formulas Without Linking Books

Manually?

I just change my formulas to text, copy the strings, paste, then change my text
strings back to formulas:

Select all the cells (ctrl-a, twice in xl2003)
edit|replace
what: =
with: $$$$$= (some unique string)
replace all

Copy and paste

Select all
edit|Replace
what: $$$$$=
with: =
replace all

(don't forget to fix it in both workbooks--or close without saving the "sending"
workbook.)

TOMB wrote:

How do I copy formulas which read from several sheets within a workbook into
another workbook? Currently, as I copy from one book to another, Excel wants
to link the two books. The books have identical sheet names/page design.

Example:
Copy from:
MyFile.xls cell A1 formula
=Jan!C5+Feb!C5+Mar!C5+Apr!C5

Paste to:
Newfile.xls Cell A1 becomes:
='[MyFile.xls]Jan'!C5+'[MyFile.xls]Feb'!C5+'[MyFile.xls]Mar'!C5+'[MyFile.xls]Apr'!C5

Can I copy without linking?

Thanks in advance!


--

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
Macro 4 copy & paste between 2 books/files FARAZ QURESHI Excel Discussion (Misc queries) 1 October 7th 07 06:41 PM
How do I copy & paste formulas without them linking to the source Ineluctable Excel Discussion (Misc queries) 8 December 11th 05 08:49 PM
Copy-Paste Special-linking problem AW Excel Programming 0 April 18th 04 07:42 PM
Copy & Paste without the formulas Steven Cheng[_2_] Excel Programming 2 July 31st 03 09:43 PM
Put copy/paste between books in macro Rajat[_3_] Excel Programming 0 July 17th 03 06:00 PM


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