好文档 - 专业文书写作范文服务资料分享网站

原创—EXCEL VBA SPC自定义函数包括CPK PPK CP……

天下 分享 时间: 加入收藏 我要投稿 点赞

As Integer, Optional SEE As Integer) As Variant

Dim AV As Single, T As Single, Su As Single, SE As Single, k As Single T = USL - LSL k = USL + LSL AV = k / 2

If SEE = 0 Then SE = T / CPK / 6 Else

SE = T / CPK / SEE End If

Su = Application.WorksheetFunction.RoundUp(0.0000000000001, WS) If JRS = 0 Then RANDS =

Application.WorksheetFunction.RoundUp(Application.WorksheetFunction.Ceiling(Application.WorksheetFunction.NormInv(Rnd(), AV, SE), Su), WS) End If

If JRS = 2 Then RANDS =

Application.WorksheetFunction.RoundUp(Application.WorksheetFunction.Ceiling(Application.WorksheetFunction.NormInv(Rnd(), AV, SE), Su * 2), WS) End If

If JRS = 1 Then RANDS =

Application.WorksheetFunction.RoundUp(Application.WorksheetFunction.Ceiling(Application.WorksheetFunction.NormInv(Rnd(), AV, SE), Su * 2) + Su, WS) End If

End Function

'***************************************功能: 函数帮助文件 Sub Fuhelp(control As IRibbonControl) Dim 函数名称 As String '函数名称 Dim 函数描述 As String '函数描述 Dim 函数类别 As String '函数类别

Dim 参数个数(2) As String '函数参数描述 数组 个数 Dim arr()

函数类别 = \品质使用函数\

参数个数(0) = \函数参数第1个,规格上限\ 参数个数(1) = \函数参数第2个,规格下限\

参数个数(2) = \函数参数第3个,用于计算的数据区域\ ReDim arr(1 To 4)

arr = [{\ For i = 1 To 4

Call Application.MacroOptions(Macro:=arr(i), Description:=函数描述, Category:=函数类别, ArgumentDescriptions:=参数个数) 函数名称 = arr(i)

函数描述 = \返回数据的\函数名称 & \值\

Next i End Sub

原创—EXCEL VBA SPC自定义函数包括CPK PPK CP……

AsInteger,OptionalSEEAsInteger)AsVariantDimAVAsSingle,TAsSingle,SuAsSingle,SEAsSingle,kAsSingleT=USL-LSLk=USL+LSLAV=k/2IfSEE=0ThenSE=T/
推荐度:
点击下载文档文档为doc格式
2348g30je977xpo5846y5ap1c1kzfj00qgc
领取福利

微信扫码领取福利

微信扫码分享