【发布时间】:2017-07-21 05:43:43
【问题描述】:
我是自学成才,遇到了一些我认为很容易的问题。我有一个电子表格,我需要遍历 O 列并找到任何包含数据的单元格,并清除 H 列中相应单元格的内容。分布表一直在变化,因此最后一行数据总是在变化。下面是我一直在玩但似乎无法工作的代码。任何帮助都会很棒..
Dim deleterate As Long
Dim ws As Worksheet
' set object
Set ws = Sheets("Import file")
' loop through the data to find the $$ amounts in column o
For deleterate = ws.Range("O" & Row.count).End(xlUp).Row To 1 Step -1
' indentify values in O which have value
If ws.Range("O" & deleterate).Value <> 0 Then
Cells(0, 7).ClearContents
End If
【问题讨论】: