过了一段时间,因为我已经完成了一些编程工作,并且我没有使用简单的excel vba宏。我有一列的数据,我需要选择然后删除不包含特定值的单元格。我的数据是这样的一列:在Excel中搜索列,找到值,选择并删除
990ppbAu/1,2
990ppbAu/0,5
990ppbAu/0,5
990ppbAu/0,3
9900ppmZr/29,1
9900ppmZn/5,2
9900ppmZn/1
9900ppmZn/0,8
9900ppmZn/0,5
9900ppmCu/2,8
我需要删除该值或STRI在他们中不包含“Au”的ngs。这里是我的代码的开始,这不是很多,可能是错的......但我希望有人能指出我在正确的方向:
Option Explicit
Sub SearchColumn()
Dim strAu As String
Dim rngFound, rngDelete As Range
strAu = "*Au*"
'Search Column
With Columns("AF")
'Find values without "Au" in string in column AF and delete.
Set rngFound = .Find(strAu, .Cells(.Cells.Count), xlValues, xlWhole)
If rngFound <> strAu
'Then select the value and delete
'Else move onto the next cell until end of the document
End With
End Sub
我应该注意到,一些细胞有没有在其中,而有些具有如上所示的字符串值。我需要它贯穿整个专栏直到文档结束。表中有大约115,000条记录。提前致谢!
是否要删除单元格的内容或单元格本身(以便所有其他值都向上移动)? –
只是单元格的内容。没有任何其他值的移动 –