Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code that copies a specific worksheet from one workbook,
to another. Problem is, that the format of the worksheet is lost during the copy. Is there a way to make sure that, when copied, the worksheet I have just pasted looks exactly like the original? Thanks for any help! Patk Sub SheetCopyBetweenFiles(sourcefile, destfile, sheetnametocopy, aftersheet) Dim srcbook, destbook As Workbook Dim copysheet, newsheet As Worksheet Workbooks(sourcefile).Activate Set srcbook = ActiveWorkbook Set copysheet = srcbook.Worksheets(sheetnametocopy) Set destbook = Workbooks(destfile) With destbook .Worksheets.Add after:=.Worksheets(.Worksheets.Count) .ActiveSheet.Name = sheetnametocopy copysheet.Cells.Copy .Worksheets(.Worksheets.Count).Cells End With Set srcbook = Nothing Set copysheet = Nothing Set destbook = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy Header/Footer to Retain Formatting | Excel Discussion (Misc queries) | |||
copy/paste want to retain cell coloration but lose the conditional formatting source data | Excel Discussion (Misc queries) | |||
retain formatting as an actual value | Excel Worksheet Functions | |||
How do I copy and paste Excel charts and retain formatting? Mine . | Charts and Charting in Excel | |||
how do I make a copy of a worksheet and retain formulas but not data | Setting up and Configuration of Excel |