+ Reply to Thread
Results 1 to 3 of 3

Copy worksheet, rename, merged cell problem??

  1. #1
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Copy worksheet, rename, merged cell problem??

    Hi all, i have some code below that i have put together to copy a worksheet using the sheet name and some text and the value in A1 i havent got it to run right the way through yet it stops at the Selection.PasteSpecial line in the code.....any ideas?

    Regards,
    Simon

    Sub Saveweek()
    Dim OriginalSheet
    Application.ScreenUpdating = False
    Application.EnableEvents = False
    OriginalSheet = ActiveSheet.Name
    Range("A1:N239").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets(OriginalSheet).Select
    Sheets.Add
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Columns("A:n").EntireColumn.AutoFit
    Application.CutCopyMode = False
    ActiveWindow.DisplayGridlines = False
    ActiveSheet.Select
    ActiveSheet.Name = Sheet.Name & "Starting " & Range("A1").Text
    Sheets(OriginalSheet).Select
    Range("A1").Select
    Application.ScreenUpdating = True
    Application.EnableEvents = False
    End Sub

  2. #2
    Alan McQuaid via OfficeKB.com
    Guest

    Re: Copy worksheet, rename, merged cell problem??

    Simon,

    At the end of the line "Selection.PasteSpecial Paste:=xlPasteValues,
    Operation:=xlNone," you need to place _ to get this part to work

    Alan

    Simon Lloyd wrote:
    >Hi all, i have some code below that i have put together to copy a
    >worksheet using the sheet name and some text and the value in A1 i
    >havent got it to run right the way through yet it stops at the
    >Selection.PasteSpecial line in the code.....any ideas?


    --
    Message posted via http://www.officekb.com

  3. #3
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Alan thanks for the reply but as far as i can see the modification you suggested is present! after "Skip Blanks"

    Whilst i was tired last night i forgot to mention that it stops at that part of the code because i have merged cells and it says the area it is getting pasted to should be the same size?

    Any other ideas?

    Regards,
    Simon
    Last edited by Simon Lloyd; 06-16-2006 at 08:08 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1