ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

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

求解决!能帮实现的愿帮充50元话费为酬劳

[复制链接]

TA的精华主题

TA的得分主题

发表于 2017-4-28 18:21 | 显示全部楼层 |阅读模式
要求在附件

缝纫车间日报表4.rar

65.42 KB, 下载次数: 29

TA的精华主题

TA的得分主题

发表于 2017-4-28 18:33 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
做个类出来就好处理了

TA的精华主题

TA的得分主题

发表于 2017-4-28 18:43 来自手机 | 显示全部楼层
我就想标记一下,看看最终谁拿走这50元?呵呵!

TA的精华主题

TA的得分主题

发表于 2017-4-28 18:45 来自手机 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2017-4-28 19:03 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
duquancai 发表于 2017-4-28 18:43
我就想标记一下,看看最终谁拿走这50元?呵呵!

我也标记一下学习一下

TA的精华主题

TA的得分主题

发表于 2017-4-28 19:24 | 显示全部楼层
Public arr

Private Sub Worksheet_Change(ByVal Target As Range)
brr = Sheet2.UsedRange
Set d1 = CreateObject("scripting.dictionary")
Set d = CreateObject("scripting.dictionary")
If Target.Column = 3 And Target.Row > 4 And Target.Count = 1 And Target <> "" Then
  Target.Offset(, 1) = ""
  Target.Offset(, 2) = ""
  For j = 1 To UBound(arr)
    If arr(j, 1) = Target Then d(arr(j, 2)) = ""
  Next j
  s = ""
  For Each c In d.keys
    s = s & "," & c
  Next c
  d.RemoveAll
  With Target.Offset(, 1).Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=Right(s, Len(s) - 1)
  End With
  
  For i = 2 To UBound(brr)
   If brr(i, 2) = Target Then
   d1(brr(i, 3)) = ""
   d2(brr(i, 2) & "||" & brr(i, 3)) = brr(i, 4)
   End If
  Next
k = d1.keys
For i = 0 To d1.Count - 1
  f = f & k(i) & ","
Next
With Target.Offset(, 5).Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=f
End With
  
  Target.Offset(, 1).Select
End If


If Target.Column = 4 And Target.Row > 4 And Target.Count = 1 And Target <> "" Then
  Target.Offset(, 1) = ""
  For j = 1 To UBound(arr)
    If arr(j, 1) & "," & arr(j, 2) = Target.Offset(, -1) & "," & Target Then d(arr(j, 3)) = ""
  Next j
  s = ""
  For Each c In d.keys
    s = s & "," & c
  Next c
  d.RemoveAll
  With Target.Offset(, 1).Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=Right(s, Len(s) - 1)
  End With
  Target.Offset(, 1).Select
End If


If Target.Column = 5 And Target.Row > 4 And Target.Count = 1 And Target <> "" Then

    With Sheet1
        .Cells(Target.Row, 6).Select
        .Cells(Target.Row, 6) = Application.WorksheetFunction.VLookup(.Cells(Target.Row, 3) & .Cells(Target.Row, 4) & .Cells(Target.Row, 5), Sheet3.Range("A:F"), 5, 0)
        .Cells(Target.Row, 7) = Application.WorksheetFunction.VLookup(.Cells(Target.Row, 3) & .Cells(Target.Row, 4) & .Cells(Target.Row, 5), Sheet3.Range("A:F"), 6, 0)
   
    End With
End If
If Target.Column = 8 And Target.Row > 4 And Target.Count = 1 And Target <> "" Then
For i = 2 To UBound(brr)
   If brr(i, 2) = Target.Offset(0, -5) And brr(i, 3) = Target Then jg = brr(i, 4)
Next
Target.Offset(0, 1) = jg
End If
End Sub

Public Sub worksheet_selectionchange(ByVal Target As Range)
Dim j&, s$, d As Object, c
Set d = CreateObject("scripting.dictionary")
With Sheets("裁剪数")
arr = .Range("b2:f" & .[a1048576].End(xlUp).Row)
End With
If Target.Column <> 3 Or Target.Row < 5 Or Target.Count <> 1 Then Exit Sub
For j = 1 To UBound(arr)
  d(arr(j, 1)) = ""
Next j
For Each c In d.keys
  s = s & "," & c
Next c
With Target.Validation
  .Delete
  .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=Right(s, Len(s) - 1)
End With
End Sub

TA的精华主题

TA的得分主题

发表于 2017-4-28 19:29 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
缝纫车间日报表4.zip (65.07 KB, 下载次数: 44)

评分

1

查看全部评分

TA的精华主题

TA的得分主题

发表于 2017-4-28 22:20 | 显示全部楼层
本帖最后由 未忘初心 于 2017-4-28 22:25 编辑

参考学习 O(∩_∩)O 缝纫车间日报表4(Bak)42009.rar (70.47 KB, 下载次数: 16)

TA的精华主题

TA的得分主题

发表于 2017-4-29 07:14 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
我就想标记一下,看看最终谁拿走这50元?

TA的精华主题

TA的得分主题

 楼主| 发表于 2017-4-29 08:16 | 显示全部楼层
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

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

GMT+8, 2024-3-29 23:03 , Processed in 0.052203 second(s), 14 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

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

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

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