MS Excel 2007 - Quick Function Question

Solved/Closed
Gessen - Sep 22, 2011 at 09:06 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Sep 23, 2011 at 03:34 AM
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
Related:

2 responses

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 552
Sep 22, 2011 at 09:19 AM
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
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Sep 23, 2011 at 03:34 AM
Why not filter on that value and erase the visible cell ?
0