LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Copy fixed range of multiple sheets into new workbook

Hi A,

Try something like:

Public Sub aTester001()
Dim srcWB As Workbook
Dim destWB As Workbook
Dim SH As Worksheet
Dim destSH As Worksheet
Dim srcRng As Range
Dim blOK As Boolean
Const sStr As String = "PY" '<<=== CHANGE

Set srcWB = Workbooks("MyBokk.xls") '<<=== CHANGE

blOK = True
For Each SH In srcWB.Worksheets
If UCase(SH.Name) Like UCase("*" & sStr) Then
If blOK Then
Set destWB = Workbooks.Add
End If
blOK = False
With destWB
Set destSH = .Sheets.Add( _
After:=.Sheets(.Sheets.Count))
End With
With destSH
.Name = SH.Name
SH.Range("B4:S40").Copy Destination:=.Range("A1")
End With
End If
Next SH

End Sub
'<<=============


---
Regards,
Norman


"A. Karatas" wrote in message
ups.com...
I have a workbook with multiple sheets in them. I want to copy a
particular fixed range of each sheet, in which the sheetname ends on
PY) into a new workbook. For example sheetname= Emuls(actual vs PY)
range b4:s40.

Each range has to be copied into a (seperate) new sheet with the
sheetname it had on the original workbook.

I have no clou how to start the procedure????

thankx in advance



 
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
copy chart between multiple sheets in workbook Sam Charts and Charting in Excel 4 March 12th 10 03:59 PM
Copy cell (C6) from multiple sheets in a wbook to another workbook [email protected] Excel Programming 0 February 9th 07 03:30 PM
Copy cell (C6) from multiple sheets in a wbook to another workbook [email protected] Excel Programming 0 February 9th 07 03:30 PM
How do I copy print formatting to multiple sheets in a workbook? BFB@keystone Excel Discussion (Misc queries) 2 March 29th 06 01:34 AM
copy data in one sheet to multiple sheets in same workbook BrianMultiLanguage Excel Worksheet Functions 4 July 27th 05 07:26 PM


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