Wednesday, August 17, 2011

Making Different Workbook WithOut Formulas :

If you have a workbook which contain Lot of Function and you want to copy all that values in another Workbook You can use this Code :



Sub GetALlSheet()
    Dim sh As Worksheet
    Dim wb As Workbook
    Set wb = ActiveWorkbook
        Application.Workbooks.Add
        For Each sh In wb.Sheets
            sh.Copy ActiveWorkbook.Sheets(1)
                ActiveSheet.Cells.Copy
                Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                Application.CutCopyMode = False
        Next
        ActiveWorkbook.SaveAs "D:\MyWorkbook"
        ActiveWorkbook.Close
End Sub

No comments: