ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

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

[Emily 分享]

[复制链接]

TA的精华主题

TA的得分主题

 楼主| 发表于 2005-8-17 12:16 | 显示全部楼层

TA的精华主题

TA的得分主题

 楼主| 发表于 2005-8-17 12:16 | 显示全部楼层

TA的精华主题

TA的得分主题

 楼主| 发表于 2005-8-17 12:17 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
Reserved

TA的精华主题

TA的得分主题

 楼主| 发表于 2005-8-17 12:20 | 显示全部楼层

模擬改變備註三角形的顏色

Public Function fncCreateCommentIndicator(CommentIndicatorColor) As Boolean 'covers the comment indicators in the activeworkbook with a similar triangle 'of the specified color, based on the user name Dim IDnumber As Long Dim aCell As Range Dim aComment As Comment Dim aShape As Shape Dim aWorksheet As Worksheet Dim aWorkbook As Workbook fncCreateCommentIndicator = False On Error GoTo ExitFunction Set aWorkbook = ActiveWorkbook IDnumber = 0 For Each aWorksheet In aWorkbook.Worksheets For Each aShape In aWorksheet.Shapes If Left(aShape.Name, Len("CommentIndicator")) = "CommentIndicator" Then aShape.Delete End If Next aShape For Each aComment In aWorksheet.Comments Set aCell = aComment.Parent If InStr(1, aComment.Shape.TextFrame.Characters.Text, ":") > 0 Then If Left(aComment.Shape.TextFrame.Characters.Text, _ InStr(1, aComment.Shape.TextFrame.Characters.Text, ":") - 1) = _ Application.UserName Then GoSub CreateCommentIndicator End If End If Next aComment Next aWorksheet fncCreateCommentIndicator = True ExitFunction: On Error GoTo 0 Set aCell = Nothing Set aComment = Nothing Set aShape = Nothing Set aWorksheet = Nothing Set aWorkbook = Nothing Exit Function CreateCommentIndicator: Set aShape = aWorksheet.Shapes.AddShape(Type:=msoShapeRightTriangle, _ Left:=aCell.Left + aCell.Width - 5, Top:=aCell.Top, Width:=5, Height:=5) IDnumber = IDnumber + 1 With aShape .Name = "CommentIndicator" & CStr(IDnumber) .IncrementRotation -180# .Fill.Visible = msoTrue .Fill.Solid .Fill.ForeColor.RGB = CommentIndicatorColor .Line.Visible = msoTrue .Line.Weight = 1 .Line.Style = msoLineSingle .Line.DashStyle = msoLineSolid .Line.ForeColor.RGB = CommentIndicatorColor End With Return End Function Sub test_fncCreateCommentIndicator() fncCreateCommentIndicator vbGreen End Sub

[此贴子已经被作者于2005-8-18 1:21:54编辑过]

TA的精华主题

TA的得分主题

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

谢谢 Emily 版主吖。

TA的精华主题

TA的得分主题

发表于 2005-8-17 13:56 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册

经测试,没有去掉原来的三角,只是在原三角上面覆盖了一个三角,而且此新增的三角形可以选中并可移动

不过此方法也很不错![em17]

TA的精华主题

TA的得分主题

发表于 2005-8-17 17:23 | 显示全部楼层
以下是引用清风_ll在2005-8-17 13:56:00的发言:

经测试,没有去掉原来的三角,只是在原三角上面覆盖了一个三角,而且此新增的三角形可以选中并可移动

不过此方法也很不错![em17]

就是就是!先收下了

TA的精华主题

TA的得分主题

发表于 2005-8-17 17:31 | 显示全部楼层
可惜列宽变了,此Shape就变形了。

TA的精华主题

TA的得分主题

 楼主| 发表于 2005-8-17 18:18 | 显示全部楼层

经测试,没有去掉原来的三角,只是在原三角上面覆盖了一个三角,而且此新增的三角形可以选中并可移动
[em17] [em04]

可惜列宽变了,此Shape就变形了。
Run macro again

TA的精华主题

TA的得分主题

发表于 2005-8-17 20:06 | 显示全部楼层
以下是引用Emily在2005-8-17 18:18:00的发言:

。 Run macro again

的确还是列宽变了,Shape变形了。环境是Off_XP_EN+Win_XP_EN。

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

本版积分规则

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

GMT+8, 2024-5-5 23:16 , Processed in 0.035193 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

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

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

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