+ Reply to Thread
Results 1 to 2 of 2

How to copy -paste exactly except formula

Hybrid View

suman.biswas How to copy -paste exactly... 04-07-2010, 10:47 AM
davegugg Re: How to copy -paste... 04-07-2010, 11:36 AM
  1. #1
    Registered User
    Join Date
    11-10-2008
    Location
    India
    Posts
    35

    How to copy -paste exactly except formula

    Hi,
    I need to copy and paste one sheet to another sheet exactly (values, formatting, grouping, zooming etc) but except formula.

    How can I do it. Please provide me the code for this 'paste special' work.

    Thanks in advance,
    Suman

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: How to copy -paste exactly except formula

    Hi

    Not sure what you mean by "grouping", but this will do the other three things you asked for.

    Public Sub suman()
    
    Dim SourceSheet As String
    Dim DestSheet As String
    Dim Szoom As Integer
    
    SourceSheet = "Sheet1" 'Set to your source sheet
    DestSheet = "Sheet3" ' Set to your destination sheet
    Szoom = ActiveWindow.zoom
    
    Sheets(SourceSheet).Activate
    Sheets(SourceSheet).Cells.Copy
    
    With Sheets(DestSheet)
        .Activate
        .Cells(1, 1).PasteSpecial xlPasteValues
        .Cells(1, 1).PasteSpecial xlPasteFormats
        ActiveWindow.zoom = Szoom
    End With
    
    Application.CutCopyMode = False
    
    End Sub
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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