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
什麼是代碼中的錯誤。代碼將「規範」表並在那裏計算,儘管排除它停止循環在少數工作表上工作
@simoco你能plzz解釋或者試試吧.. 我新來這個東西。 – user3564381
有什麼解釋?我不明白你的問題 –
我已經使用 如果ws.Name <>「Sheet1」和ws.Name <>「Norms」和ws.Name <>「Sheet3」和ws.Name <>「Sheet4」然後 以防止代碼去像「規範」提到的表。但 它沒有發生 – user3564381