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: 4
Default Skipping sheets when copying

I have a code, that copies sheets from one workbook to another. The code looks like this:

Sub CopyShees()
Path = Range("h1")
Filename = Dir(Path & "*.xlsm")
Do While Filename < ""
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
For Each Sheet In ActiveWorkbook.Sheets
Sheet.Copy After:=ThisWorkbook.Sheets(worksheets.count)
Next Sheet
Workbooks(Filename).Close
Filename = Dir()
Loop
End Sub

And it actually works. But I like it to skip the sheets in the Activeworkbook, that already exist in ThisWorkbook, so it only copies "new" sheets from the active workbook.

I have treid different approaches but with no succes so far. Anybody?
 
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 a formula but not skipping ref cells Picc About this forum 0 March 8th 13 01:05 AM
Copying a formula but 'skipping' a cell Mike Langensiepen New Users to Excel 2 May 3rd 07 06:17 AM
Copying values skipping blanks justaguyfromky Excel Programming 1 February 9th 07 12:27 AM
Copying and skipping (adding) rows [email protected] Excel Programming 1 January 22nd 06 06:35 PM
copying and skipping consecutive row data archie Excel Programming 0 November 15th 04 10:05 PM


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