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: 333
Default CopySheet After

Hi,

I have a list of sheet names and when a new sheet is created it is added in
sequetial order on the list. When a new sheet is created, I'm trying to have
it placed after the item on the list before it. I error out at the copy
statement. It tells me it failed. I am unable to determine why. In debug,
the correct sheetname and Sheetnumber appear in the variables, so I'm at a
loss.

Does anyone have any suggestions?

If MainPagepg.Range("BC" & NewRow - 1) = "" Then
ShNumber = Firstpg.Index
Else
AfterShName = MainPagepg.Range("BC" & NewRow - 1).Value
ShNumber = Sheets(AfterShName).Index
End If

CAMMaster.Activate

Call NewSheetName(SheetName)
If SheetName = "" Then Exit Sub

'copy the sheet
ActiveSheet.Copy After:=Sheets(ShNumber)


Thanks for your help.
--

Karen
 
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



All times are GMT +1. The time now is 10:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"