Hi,
I have written a short piece of code based on some other posts and for some reason it doesn't work and it's driving me mad. The task seems to be very easy - I'm trying to get rid of some formulas in all worksheets and keep the actual values only. The part that is failing is the following: ws.Range("A1:P31").Select
When I take out "ws" from ws.Range("A1:P31").Select then the code works fine, but it doesn't loop through all worksheets - it executes 78 times the code on the active worksheet....Sub CopyPasteSpecialAllSheets() Dim ws As Worksheet Application.ScreenUpdating = False For Each ws In Worksheets ws.Range("A1:P31").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues Application.CutCopyMode = False Next ws End Sub
Any ideas on how to fix it and why this happens?
Bookmarks