MS Excel 2007 - Quick Function Question [Solved/Closed]

Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hi Guys,

So say you have 3 cells. A, B, and C. I'm trying to come up with a function to put in C that erases/blanks A if B is #N/A (IsError?). Can anbody help me out with this?

Thanks,

Gessen

2 replies

Posts
2720
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
April 19, 2021
459
Hi Gessen,

Formula's / functions can only gather information for you. To delete you will have to make use of a macro.
Try this one:
Sub test()
Dim x As Integer
Dim y As Integer
x = 1
y = Range("A" & Rows.Count).End(xlUp).Row
Do
If IsError(Range("B" & x)) = True Then Range("A" & x).ClearContents
x = x + 1
Loop Until x = y
End Sub

Best regards,
Trowa
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
Why not filter on that value and erase the visible cell ?

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!