Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 716|回复: 3

[已解决]怎样根据图中有颜色单元格里的文字,添加语句才能实现新的条件?

[复制链接]
发表于 2023-5-27 11:42 | 显示全部楼层 |阅读模式
QQ截图20230527112837.png

2023-5-27---.zip (59.1 KB, 下载次数: 1)
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2023-5-28 13:23 | 显示全部楼层
将 If Target.Address = "$BZ$1" Then
改成 If Target.Address = "$BZ$1" And Target >= 4 Then
回复

使用道具 举报

 楼主| 发表于 2023-5-28 17:55 | 显示全部楼层
zjdh 发表于 2023-5-28 13:23
将 If Target.Address = "$BZ$1" Then
改成 If Target.Address = "$BZ$1" And Target >= 4 Then

非常感谢老师,我测试了一下,不知什么原因没有成功,老师您有时间再帮我看看,拜托了!
回复

使用道具 举报

发表于 2023-6-2 09:22 | 显示全部楼层    本楼为最佳答案   
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Target.Address = "$BZ$1" And Target >= 4 Then
        arr = Range("bx60:bx7261")
        x = Target
        ReDim brr(1 To UBound(arr), 1 To 1)
        For i = UBound(arr) - x + 1 To 1 Step -x
            brr(UBound(arr) - n, 1) = arr(i, 1)
            n = n + 1
        Next
        Range("bz60:bz7261") = brr
    End If
End Sub
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-27 00:41 , Processed in 0.160411 second(s), 9 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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