I am trying to loop on all the worksheets of a workbook and copy-paste in values. Here is my code:
Sub paste_hard()
Dim ws As Worksheet
Dim rng As Range
For Each ws In ActiveWorkbook.Worksheets
Set rng = ws.Range("A1:C500")
rng.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Next ws
Range("A1:C500") = rng
End Sub
Problem comes from rng.Select
and I get the following error:
Method 'Select' of object 'Range' failed
I am a beginner in vba.