繁体   English   中英

使用Excel VBA删除地址位于另一个单元格中的单元格

[英]Delete cell in which address is in another cell using excel vba

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

很简单?

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

之前 在此处输入图片说明

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM