LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default HAVE ONE REPORT SHEET WITH LINKS FROM VARIOUS SHEETS. ON COPYING THIS LINKED SHEET FOR EXPORTING IT TO THE OFFICE GET ERRORS IN CELLS. HOW TO RESOLVE THIS?

When I am copying an entire sheet, with formulas, links, and merged cells,
to another workbook or new workbook, I use this code:

Dim Wb1 As Workbook 'Originating workbook
Dim Wb2 As Workbook ''Copy to" workbook
Set Wb1 = ActiveWorkbook
Set Wb2 = Workbooks.Open("C:\Your file to open.xls")

' Or

'Workbooks.Add
'Set Wb2 = ActiveWorkbook

Wb1.Sheets("Sheet1").Copy _
after:=Wb2.Sheets(Wb2.Sheets.Count)
Cells.Copy
Cells.PasteSpecial xlPasteValues

This retains all of the original formatting but sets all formulas and links
to values.


When I am copying portions of the sheet to another sheet:

Wb1. Activate
Range("So & So").Copy
Wb2.Activate
Range("So & So").PasteSpecial xlPasteValues
Range("So & So").PasteSpecial xlPasteFormats


Mr. Phillips is totally correct about Merged cells. They are a pain. They
require additional code and sometimes can not be set at all due to the
formatting of the worksheet being pasted to. Every case of Merged cells has
to be tested. If you feel you need merged cells, the best approach to Copy
is by using xlPasteValues & xlPasteFormats.

Regards,

Alan





"CAPTGNVR" wrote in message
ps.com...
DEAR ALL
I have about 16 sheets of various calculations. In some sheets i have
links from the remaining sheets which sort of sums up my reports for
the day to the company. I did face lots of problems like, i cant copy
and paste becos cells are not identical or merged cells problems etc.
At present i have been selecting cells-copy-workbook add- paste.
After some learning through this forum, i put offset formulas so that
i dont need to write it in VB. Now the problem is when i see the sheet
which i export t has #value messages.
I will be proceeding on leave from this ship-- so pls help me quickly
in advising me how to
1. Best way to copy from a sheet which has links, merged cells to a
new sheet.
2. Is there a way to code it in VB, where once i select the cells, I
would like to copy values, formats everything except the links and
formulas.
Eagerly awaiting n pls help.





 
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 text on sheet 1 to corresponding cells on sheets 2 to 5 Lisa New Users to Excel 5 October 1st 08 06:01 AM
sorting master sheet messes up cells in other sheets linked to it Kt Excel Worksheet Functions 1 October 30th 05 12:25 PM
sorting master sheet messes up cells in other sheets linked to it Kt Excel Worksheet Functions 0 October 30th 05 10:36 AM
Report: Copying pagebreaks of a reference sheet to other sheets masayoshi hayashi Excel Programming 1 December 26th 03 03:10 AM
Errors when copying a sheet Keith[_4_] Excel Programming 4 August 16th 03 02:31 AM


All times are GMT +1. The time now is 04:31 AM.

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"