+ Reply to Thread
Results 1 to 3 of 3

copy paste selected worksheets to new workbook as values

  1. #1
    Forum Contributor
    Join Date
    04-25-2014
    Location
    India
    MS-Off Ver
    Excel pro plus 2021
    Posts
    186

    copy paste selected worksheets to new workbook as values

    hello friends ,

    i have work book , it has around 10 sheets with lots of formulas in it , also with some hyperlinks

    sheet1 : 05055
    sheet2 : 05560
    sheet3 : 06065
    sheet4 : 06570
    sheet5 : 07075
    sheet6 : 07580
    sheet7 : 08085
    sheet8 : 08590
    sheet9 : 09095
    sheet10 : 09510

    i want to copy first 5 worksheets to new work book with values and hyperlinks ....
    then
    i want to copy another remaining five to same new work book as values and hyperlinks again ....

    purpose of doing so , is ......my excel gets hang when i use vba for entire work book at once ....

    i was using below code ...for smaller workbooks previously ...


    Sub CopyWSToNewWB()
    Dim anySheet As Worksheet

    ActiveWorkbook.Sheets.Copy

    For Each anySheet In ActiveWorkbook.Worksheets
    anySheet.UsedRange.Copy
    anySheet.UsedRange.PasteSpecial Paste:=xlPasteValues
    Application.CutCopyMode = False
    Next

    End Sub

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: copy paste selected worksheets to new workbook as values

    Is there a problem with that code?

    It looks fine to me, though you would need to adapt it to only copy the worksheets you want rather than all worksheets.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    04-25-2014
    Location
    India
    MS-Off Ver
    Excel pro plus 2021
    Posts
    186

    Re: copy paste selected worksheets to new workbook as values

    sir ,
    there is no problem , its working fine ,

    but i am new to vba coding .....

    so i dont know how to modify this code for sheets i want to copy paste to new workbook ...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 05-01-2013, 05:37 AM
  2. [SOLVED] Copy selected range of data and paste in new open workbook
    By coach.32 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2013, 03:41 AM
  3. Copy/Paste Range of Data from Multiple Workbooks/Worksheets to Master Workbook/Worksheets
    By NumberCruncher311 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-19-2013, 08:21 PM
  4. Copy selected cells from a range of worksheets and paste in master table
    By simba3088 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-20-2012, 07:59 AM
  5. Macro to copy and paste values in a selected row
    By marianov in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-05-2012, 05:21 PM

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