取单元格红色字体的VBA自定义函数
代码
1 Function GetColorChar(Rng As Range)
2 Application.Volatile True
3 Dim i%, str$
4 For i = 1 To Len(Rng)
5 If Rng.Characters(i, 1).Font.Color = 255 Then
6 str = str & Mid(Rng.Value, i, 1)
7 End If
8 Next
9 GetColorChar = str
10 End Function
效果如下图:
作者:laoyebin(Paladin.lao)
出处:http://www.cnblogs.com/laoyebin/
网赚 :https://laoyebin.com/
优惠码发布:https://yhmfb.com/
导读网:https://daodu.co/
外汇吧:https://waihui.pub/
本文版权归作者和博客园共有,欢迎转载,但请保留作者信息和原文链接,非常感谢。
反馈文章质量,你可以通过快速通道评论: