Hi
Please could someone help with the code for looping through ALL the sheets in a workbook, copying ALL the cells and pasting the values?
Many thanks
Roasty
Hi
Please could someone help with the code for looping through ALL the sheets in a workbook, copying ALL the cells and pasting the values?
Many thanks
Roasty
Last edited by roasty_1; 10-29-2008 at 09:17 AM.
Courtesy of Aaron Blood
![]()
Sub Formula_Zapper() Worksheets.Select Cells.Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues ActiveSheet.Select Application.CutCopyMode = False End Sub
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Thanks, I tried this but I kept getting an error:
Run-time error '1004';
Method 'Select' of object 'sheets' failed
why is this?
thanks
Have you hidden sheets?
Try this![]()
Option Explicit Sub Formula_Zapper_MkII() Dim sh As Worksheet, HidShts As New Collection For Each sh In ActiveWorkbook.Worksheets If Not sh.Visible Then HidShts.Add sh sh.Visible = xlSheetVisible End If Next sh Worksheets.Select Cells.Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues ActiveSheet.Select Application.CutCopyMode = False For Each sh In HidShts sh.Visible = xlSheetHidden Next sh End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks