Sub Macro5()
Dim filename As String
Dim MyRefAddr As String
Dim MyCopyAddr As String
Dim MyDestAddr As String
Dim NoOfCols As Integer
Dim lastRow As Long
Dim Distributor As String
Dim Z As Double
Dim Davg As Double
Dim LT As Long
Dim temp As Long
Worksheets.Add(Before:=Worksheets(1)).Name = "Norms"
Sheets("Norms").Select
Range("A1").Select
ActiveCell.Value = "SKU"
MyCopyAddr = Range("A1").Offset(1, 0).Address
Range("A1").Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "=Sheet3!RC"
Range(MyCopyAddr).AutoFill Destination:=Range(MyCopyAddr + ":A69")
For Each ws In ActiveWorkbook.Sheets
If ws.Name <> "Sheet1" And ws.Name <> "Norms" And ws.Name <> "Sheet3" And ws.Name <> "Sheet4" Then
Range("B5").Select
Selection.End(xlToRight).Select
MyRefAddr = ActiveCell.Address
NoOfCols = Application.WorksheetFunction.Count(Range("B5:" + MyRefAddr))
'STDEV
MyCopyAddr = Range(MyRefAddr).Offset(-1, 1).Address
Range(MyRefAddr).Offset(-1, 1).Select
ActiveCell.Value = "Sigma D"
End If
Next ws
End Sub
Whats the error in the code. THe code is going to "norms" sheet and calculating there inspite of excluding it