|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
写了一个自定义函数,如下图所示——
具体代码如下所示——
- Option Explicit
- Function FilterData(dbSource As Range, strName As Range, strItem As Range, intDay As Integer)
- Application.Volatile (True)
- Dim k As Range, strAddress
- Set k = dbSource.Find(IIf(Len(strName) * Len(strName.Offset(0, -4)) > 0, strName.Value, strName.End(xlUp).Value), LookIn:=xlValues)
- If Not k Is Nothing Then
- strAddress = k.Address
- Do
- If CInt(Right(k.Offset(1, 0), 2)) = intDay Then
- Select Case strItem
- Case "网点开户"
- FilterData = Split(k.Offset(2, 0), ":")(1)
- Case "手机签约"
- FilterData = Split(k.Offset(3, 0), ":")(1)
- Case "网银签约"
- FilterData = Split(k.Offset(4, 0), ":")(1)
- Case "手机新增"
- FilterData = Split(k.Offset(5, 0), ":")(1)
- Case "网银新增"
- FilterData = Split(k.Offset(6, 0), ":")(1)
- Case "手机二次"
- FilterData = Split(k.Offset(7, 0), ":")(1)
- Case "手机活跃"
- FilterData = Split(k.Offset(8, 0), ":")(1)
- Case "网银二次"
- FilterData = ""
- Case "网银活跃"
- FilterData = ""
- Case "伦敦银行"
- FilterData = Split(k.Offset(16, 0), ":")(1)
- End Select
- Exit Do
- End If
- Loop While Not k Is Nothing And k.Address <> strAddress
- End If
- Set k = Nothing
- FilterData = IIf(FilterData = 0, "", FilterData)
- End Function
复制代码
|
-
-
汇总表.rar
41.53 KB, 下载次数: 16
打开文件需要启用宏
|