MS Excel 2007 - Quick Function Question

Solved/Closed
Gessen - Sep 22, 2011 at 09:06 AM
rizvisa1
Posts
4479
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

2 replies

TrowaD
Posts
2886
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
June 27, 2022
515
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
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
769
Sep 23, 2011 at 03:34 AM
Why not filter on that value and erase the visible cell ?
0