Excel精英培训网

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

求能自动引用对应批注的公式

[复制链接]
发表于 2017-2-20 07:10 | 显示全部楼层 |阅读模式
具体要求见附件,谢谢!
    222.rar (495.68 KB, 下载次数: 8)
发表于 2017-2-20 10:45 | 显示全部楼层
Sub tt()
Dim ends%, d, i%
Set d = CreateObject("scripting.dictionary")
With Sheet1
    ends = .Range("d1").End(xlDown).Row
    For i = 2 To ends
        If .Cells(i, "o").Comment Is Nothing Then
            d(.Cells(i, 4).Value) = ""
        Else
            d(.Cells(i, 4).Value) = .Cells(i, "o").Comment.Text
        End If
    Next
End With
i = 2
Do
    i = i + 1
    Cells(i, "M").Value = d(Cells(i, 1).Value)
Loop Until Range("a" & i) = ""
End Sub
回复

使用道具 举报

 楼主| 发表于 2017-2-20 13:08 | 显示全部楼层
苏子龙 发表于 2017-2-20 10:45
Sub tt()
Dim ends%, d, i%
Set d = CreateObject("scripting.dictionary")

老师:不会用,能否写在附件里,谢谢!
回复

使用道具 举报

发表于 2017-2-21 07:54 | 显示全部楼层
wzd28 发表于 2017-2-20 13:08
老师:不会用,能否写在附件里,谢谢!

把它放进去,运行就可以了

222.zip

511.54 KB, 下载次数: 34

回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-25 00:37 , Processed in 0.267205 second(s), 10 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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