If rg1.Rows.Count <> rg2.Rows.Count Or rg1.Columns.Count > 1 Or rg2.Columns.Count > 1 Or rg3.Columns.Count > 1 Then
LkStr = "#REF!"
Exit Function
End If
Dim r1%, r2%, r%, rng As Range, c1%, c2%, c%, k%, arr()
r1 = rg1.Row: r2 = rg2.Row: r = r2 - r1
c1 = rg1.Column: c2 = rg2.Column: c = c2 - c1
For Each rng In rg1
If rng.Value = rng1.Value And rng.Offset(r, c).Value = rng2.Value Then
ReDim Preserve arr(k)
arr(k) = Cells(rng.Row, rg3.Column).Value
k = k + 1
End If
Next
LkStr = Join(arr(), "")
End Function
参数说明:
LkStr (查找区域1,值单元格1,查找区域2,值单元格2,结果区域)
Function zhekou(zhanyoulv As Double, t As Integer)
If zhanyoulv <0.035 Then
If t <= 15 Then
zhekou = 0
Else
If t <= 30 And t >15 Then
zhekou = 0
Else
If t >30 Then
zhekou = 0
End If
End If
End If
Else
If zhanyoulv >= 0.035 And zhanyoulv <= 0.04 Then
If t <= 15 Then
zhekou = 0.8
Else
If t <= 30 And t >15 Then
zhekou = 1.2
Else
If t >30 Then
zhekou = 1.5
End If
End If
End If
你可以这样试一试
Else
If zhanyoulv >0.04 And zhanyoulv <= 0.045 Then
If t <= 15 Then
zhekou = 1
Else
If t <= 30 And t >15 Then
zhekou = 1.5
Else
If t >30 Then
zhekou = 2
End If
End If
End If
End If
End If
End If
End Function
Excel
Microsoft Excel是微软公司的办公软件Microsoft office的组件之一,是由Microsoft为Windows和Apple Macintosh *** 作系统的电脑而编写和运行的一款试算表软件。Excel 是微软办公套装软件的一个重要的组成部分,它可以进行各种数据的处理、统计分析和辅助决策 *** 作,广泛地应用于管理、统计财经、金融等众多领域。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)