+ Reply to Thread
Results 1 to 4 of 4

Macro to copy sheet(s) and paste as values only

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Macro to copy sheet(s) and paste as values only

    Hi all,

    I am looking for a macro that will copy a worksheet to a new workbook and 'paste as values only' - this is because I already have a macro that I am trying to use to 'autofilter' the sheet to only show rows and colums that have entries in them. Since the sheet is dynamic, the macro will not work unless I copy and paste as values only...

    Workbook attached - FYI, the 2 sheets in the workbook are actually in 2 separate books, I have just put them together to make it easier to post here...

    TIA!
    Attached Files Attached Files
    Last edited by Greed; 11-29-2011 at 02:58 PM. Reason: solved

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro to copy sheet(s) and paste as values only

    Is this what you mean?
    Option Explicit
    
    Sub CopyValues()
    'copy sheet to new workbook
        ActiveSheet.Copy
        'convert to values
        With ActiveSheet.UsedRange
            .Value = .Value
        End With
    End Sub
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    02-28-2012
    Location
    india
    MS-Off Ver
    Excel 2019
    Posts
    545

    Re: Macro to copy sheet(s) and paste as values only

    Quote Originally Posted by royUK View Post
    Is this what you mean?
    Option Explicit
    
    Sub CopyValues()
    'copy sheet to new workbook
        ActiveSheet.Copy
        'convert to values
        With ActiveSheet.UsedRange
            .Value = .Value
        End With
    End Sub
    This was what i looking for.thanks a lot. have a nice day.

  4. #4
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Macro to copy sheet(s) and paste as values only

    yes, that's it exactly - Thanks a bunch!

+ 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