LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy Workbook


Hello All.

I have this sequence running below which works just as required,
however I now need to apply it to the entire workbook as opposed to a
single sheet within the workbook.
Is there a way to run this without listing each and every sheet while
still copying formats /colours / and breaking the links?

Set srcWB = ActiveWorkbook
'copy sheet into new workbook
srcWB.Sheets("xxxxxxxx").Copy
Set destWB = ActiveWorkbook
'copy the funky colours from the report workbook
destWB.Colors = srcWB.Colors
'make the lookup section into values
With ActiveSheet.Range("AM2:AX185")
..Value = .Value
End With
ActiveSheet.Range("A1").Select
'rename sheet
ActiveSheet.Name = "xxxxxx - " & Format(Date, "yyyymmdd")
'break links
ActiveWorkbook.BreakLink Name:= _
"xxxxxxxxxxxx", Type:=xlExcelLinks
'save in archive folder
ReportFilename = _
"xxxxxxxxxxxx" & _
"xxxxxxxxxx " & ".xls"
destWB.SaveAs Filename:=ReportFilename
'close file
destWB.Close


Thanks in advance

Kristan


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile: http://www.excelforum.com/member.php...o&userid=24699
View this thread: http://www.excelforum.com/showthread...hreadid=489688

 
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 to copy an image (or picture) from one workbook to a new sheetin another workbook Ruchir Excel Worksheet Functions 1 July 25th 08 07:29 AM
Excel-how to link source workbook to copy of destination workbook D Lynn Excel Worksheet Functions 1 May 29th 08 05:36 PM
Copy cells based on conditions in one workbook to another workbook fLiPMoD£ Excel Discussion (Misc queries) 0 August 1st 07 07:43 PM
copy worksheet from closed workbook to active workbook using vba mango Excel Worksheet Functions 6 December 9th 04 07:55 AM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM


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