ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 效率神器,一键搞定繁琐工作
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
让更多数据处理,一键完成 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 103|回复: 5

[求助] 按照等级取数的公式

[复制链接]

TA的精华主题

TA的得分主题

发表于 2024-10-12 17:05 | 显示全部楼层 |阅读模式
如一类  二级  如何取到津贴?谢谢! 工作簿1.rar (7.33 KB, 下载次数: 4)

TA的精华主题

TA的得分主题

发表于 2024-10-12 17:09 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
这样?                  

工作簿1.rar

7.33 KB, 下载次数: 4

TA的精华主题

TA的得分主题

发表于 2024-10-12 19:43 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
  1. Sub nnn()
  2.     Set a = ActiveSheet
  3.     x = a.UsedRange.Rows.Count
  4.     For i = 2 To x
  5.         If a.Cells(i, 1) = "" Then
  6.             Exit For
  7.         End If
  8.         If a.Cells(i, 2) = "一类" Then
  9.             If a.Cells(i, 3) = "一级" Then
  10.                 a.Cells(i, 4) = 100
  11.             ElseIf a.Cells(i, 3) = "二级" Then
  12.                 a.Cells(i, 4) = 90
  13.             ElseIf a.Cells(i, 3) = "三级" Then
  14.                 a.Cells(i, 4) = 80
  15.             End If
  16.         End If
  17.          If a.Cells(i, 2) = "二类" Then
  18.             If a.Cells(i, 3) = "一级" Then
  19.                 a.Cells(i, 4) = 70
  20.             ElseIf a.Cells(i, 3) = "二级" Then
  21.                 a.Cells(i, 4) = 60
  22.             ElseIf a.Cells(i, 3) = "三级" Then
  23.                 a.Cells(i, 4) = 50
  24.             End If
  25.         End If
  26.          If a.Cells(i, 2) = "三类" Then
  27.             If a.Cells(i, 3) = "一级" Then
  28.                 a.Cells(i, 4) = 40
  29.             ElseIf a.Cells(i, 3) = "二级" Then
  30.                 a.Cells(i, 4) = 30
  31.             ElseIf a.Cells(i, 3) = "三级" Then
  32.                 a.Cells(i, 4) = 20
  33.             End If
  34.         End If
  35.     Next
  36.    
  37. End Sub
复制代码

TA的精华主题

TA的得分主题

发表于 2024-10-12 22:34 | 显示全部楼层
  1. Sub prectise()
  2.     Set a = ActiveSheet
  3.     Set d = CreateObject("Scripting.Dictionary")
  4.     Set rng_0 = Application.InputBox("所要获取位置", Type:=8)
  5.     x = a.UsedRange.Rows.Count
  6.    
  7.     col_0 = rng_0.Column
  8.     index_0 = rng_0.Row
  9.    
  10.     For i = index_0 To x
  11.         Key = a.Cells(i, col_0) & a.Cells(i, col_0 + 1)
  12.         d(Key) = a.Cells(i, col_0 + 2)
  13.     Next
  14.     Stop
  15.     For Each kind In d.keys
  16.         Debug.Print "键:" & kind & ",值:" & d(kind)
  17.     Next
  18.     Stop
  19.    
  20.     For j = 2 To x
  21.     current = a.Cells(j, 2) & a.Cells(j, 3)
  22.         If d.exists(current) Then
  23.             a.Cells(j, 4).Value = d(current)
  24.         ElseIf a.Cells(j, 2) = "" Then
  25.             Exit For
  26.         End If
  27.     Next
  28. End Sub
复制代码

TA的精华主题

TA的得分主题

发表于 2024-10-12 22:46 | 显示全部楼层
  1. Sub prectise()
  2.     Set a = ActiveSheet
  3.     Set d = CreateObject("Scripting.Dictionary")
  4.     Set rng_0 = Application.InputBox("所要获取位置", Type:=8)
  5.     x = a.UsedRange.Rows.Count
  6.    
  7.     col_0 = rng_0.Column
  8.     index_0 = rng_0.Row
  9.    
  10.     For i = index_0 To x
  11.         Key = a.Cells(i, col_0) & a.Cells(i, col_0 + 1)
  12.         d(Key) = a.Cells(i, col_0 + 2)
  13.     Next
  14.     Stop
  15.     For Each kind In d.keys
  16.         Debug.Print "键:" & kind & ",值:" & d(kind)
  17.     Next
  18.     Stop
  19.    
  20.     For j = 2 To x
  21.     current = a.Cells(j, 2) & a.Cells(j, 3)
  22.         If d.exists(current) Then
  23.             a.Cells(j, 4).Value = d(current)
  24.         ElseIf a.Cells(j, 2) = "" Then
  25.             Exit For
  26.         End If
  27.     Next
  28. End Sub
复制代码

TA的精华主题

TA的得分主题

 楼主| 发表于 2024-10-13 08:26 | 显示全部楼层
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-10-23 18:29 , Processed in 0.030669 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表