0

我需要使用 excel 宏删除一个单元格,其中该单元格的地址是另一个单元格中的文本。我需要代码非常简单,因为我几乎是一个完整的初学者。

4

1 回答 1

0

够简单吗?

Sub Whipe()
Dim RAddress As Range, RAdrCell As Range
Dim RWhipe As Range, RWhipeCell As Range

    Set RAddress = Range([A1], [F6]) ' range containing the addresses
    Set RWhipe = Range([A7], [F12])  ' range containing data to be whiped

    For Each RWhipeCell In RWhipe.Cells
        For Each RAdrCell In RAddress.Cells
            If RWhipeCell.Address(False, False) = RAdrCell Then
                RWhipeCell = ""
            End If
        Next RAdrCell
    Next RWhipeCell
End Sub

在此处输入图像描述

在此处输入图像描述

于 2013-07-04T11:56:45.093 回答