Results 1 to 5 of 5

Copy Excel workbook without formulas??

Threaded View

  1. #1
    Registered User
    Join Date
    01-12-2011
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    3

    Copy Excel workbook without formulas??

    Hi guys!

    I am trying to make my very first Excel macro and I have hit a snag. My background is Java, and this my first venture into anything VB or VB like...

    I have a workbook with multiple sheets. I need to copy it all to a new workbook with exception of the excel formulas - just the values, number formatting, background colours etc.


    The code I have so far does that, but only for the active sheet - can you help me out with looping through the rest?


    So far I have the following code working:

    Sub test() 
         
        Cells.Select 
         
        Selection.Copy 
        Workbooks.Add 
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False 
        Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False 
        Application.Dialogs(xlDialogSaveAs).Show 
         
         
    End Sub
    Now, can anyone encapsulate my code in a loop that will run through all sheets in the workbook? thanks!

    Last edited by Webmonkey; 01-12-2011 at 10:48 AM.

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