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: 74
Default Copy Worksheet plus ranges

Greetings,

I have a workbook that is growing in functionality. One sheet is named
Charley (for discussion). There is a range called Blocks that holds several
entries. First, I need to make one copy of Charlie for each entry in the
Blocks range. I would like the copy placed after Charlie and renamed to
reflect the concatenation of the Block name a space and Charlie. This would
be repeated for each block in the range. The code below generates Charlie(2)
and then gives me a run time error.

What am I doing wrong?

Thanks in advance for your help!

Ray


Sub Copy_Charlie()

Dim Block As Range
Dim SheetNam As String
Dim ModSheetNam As String
Dim ModSheetNam2 As String

SheetNam = "Charlie"
ModSheetNam = SheetNam

For Each Block In Range("Blocks")
ModSheetNam2 = Block.Value + " " + SheetNam

Worksheets(SheetNam).Copy(after:=Worksheets(ModShe etNam)).Name _
= ModSheetNam2

ModSheetNam = ModSheetNam2

Next
End Sub


 
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
trying to copy a worksheet containing named ranges to anotherworksheet cil9mxm Excel Worksheet Functions 1 December 3rd 08 06:06 PM
how copy formula that contains ranges so ranges do not overlap Patty Excel Worksheet Functions 1 November 20th 08 04:15 PM
Copy worksheet with named ranges to new workbook and keep names Sandy Excel Worksheet Functions 0 July 11th 08 04:37 PM
Copy worksheet ranges from One Workbook to another from halem2 Excel Worksheet Functions 0 March 24th 06 01:42 PM
Copy ranges of data from Master worksheet. Thanks [email protected] Excel Programming 4 November 24th 03 03:28 AM


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