I have created follwoing code. The macro should simply multiply the cells A2:G3000 by 1 so that the format changes from a text to a number. The macro I wrote does so, but only for the active worksheet.. I used the For Each/Next loop as I learned it.
Could somebody help me find my mistake in the code?
Sub Format_Change()
Dim sht As Worksheet
For Each sht In Worksheets
Range("M2").Select
ActiveCell.FormulaR1C1 = "=RC[-12]*1"
Range("M2").Select
Selection.AutoFill Destination:=Range("M2:W2"), Type:=xlFillDefault
Range("M2:W2").Select
Selection.AutoFill Destination:=Range("M2:W3000"), Type:=xlFillDefault
Range("M2:W3000").Select
Selection.Copy
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("M2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Application.CutCopyMode = False
Selection.ClearContents
Next sht
End Sub