Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
正如标题所示,如果单元格中的字符数 < 3,我想删除一个单元格(删除文本)。
例如
第 1 行 第 2 行 SN DWD
124 411 1 123
32 231 01 23
在这里,我想把“SN”、“1”、“32”、“01”和“23”都做成空白单元格。
假设你的意思是 Excel
Sub ClearCellsWithLessThan3Chars() Dim cell As Range For Each cell In ActiveSheet.UsedRange If (Len(cell.Text) < 3) Then cell.Clear End If Next End Sub