Excel精英培训网

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

[已解决]根据文本内容确定文本格式

[复制链接]
发表于 2015-2-3 14:52 | 显示全部楼层 |阅读模式
本帖最后由 心灵有约 于 2015-2-3 16:02 编辑

根据文本内容确定文本格式.rar (9.48 KB, 下载次数: 12)
发表于 2015-2-3 15:44 | 显示全部楼层    本楼为最佳答案   
  1. Sub Macro1()
  2. Dim rng As Range, c As Range
  3. Set rng = Range([k4], Range("k65536").End(xlUp))
  4. rng.HorizontalAlignment = xlRight
  5. For Each r In rng
  6. If r = "是" Then
  7. If c Is Nothing Then Set c = r Else Set c = Union(c, r)
  8. End If
  9. Next
  10. If Not c Is Nothing Then
  11.     c.HorizontalAlignment = xlLeft
  12.     c.Font.Bold = True
  13.     c.Font.ColorIndex = 3
  14. End If
  15. End Sub
复制代码
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-2 06:03 , Processed in 0.222587 second(s), 10 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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