I need to delete a cell using an excel macro where the address to that cell is text in another cell. I need the code to be very simple as I am almost a complete beginner.
simple enough?
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
before
after
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.