作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图突出显示包含“Alt + Enter”(又名 Chr(10))字符的所有单元格,而不管单元格的其他内容如何。我怎样才能做到这一点?
最佳答案
这应该有效:
Sub TestForChr()
Dim rng As Range
Set rng = Application.ActiveSheet.UsedRange
For Each cell In rng
If InStr(1, cell, Chr(10)) Then
cell.Interior.ColorIndex = 3
End If
Next
End Sub
Sub AnotherTestForChr()
Dim LastRow As Long, LastColumn As Long
Dim i As Long, y As Long
' LastRow = Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
' LastColumn = Sheets("Sheet1").Cells(1, Columns.Count).End(xlToLeft).Column
LastRow = Sheets("Sheet1").UsedRange.Rows.Count
LastColumn = Sheets("Sheet1").UsedRange.Columns.Count
For i = 1 To LastRow
For y = 1 To LastColumn
If InStr(1, Cells(i, y), Chr(10)) Then
Cells(i, y).Interior.ColorIndex = 3
End If
Next
Next
End Sub
关于vba - 突出显示包含 Chr(10) 的单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51972801/
有没有一种方法可以“标记”对象的属性,使它们在反射中“突出”? 例如: class A { int aa, b; string s1, s2; public int AA
我是一名优秀的程序员,十分优秀!