Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I'm using paste/special to remove vlookup functions which leave #N/A when no matches were found. I'm not getting any errors but I can't get the current cell to clear if it has the #N/A. Can anyone assist? Thanks in advance! For i = 7 To lastRow If (CStr(Cells(i, "L").Value) = "#N/A") Then Cells(i, "L").Value.Clear End If Next i -- mthomas ------------------------------------------------------------------------ mthomas's Profile: http://www.excelforum.com/member.php...o&userid=25649 View this thread: http://www.excelforum.com/showthread...hreadid=393138 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Error Resume Next
Columns(12).SpecialCells(xlFormulas,xlErrors).Clea r Columns(12).SpecialCells(xlConstants,xlErrors).Cle ar On Error goto 0 -- Regards, Tom Ogilvy "mthomas" wrote in message ... I'm using paste/special to remove vlookup functions which leave #N/A when no matches were found. I'm not getting any errors but I can't get the current cell to clear if it has the #N/A. Can anyone assist? Thanks in advance! For i = 7 To lastRow If (CStr(Cells(i, "L").Value) = "#N/A") Then Cells(i, "L").Value.Clear End If Next i -- mthomas ------------------------------------------------------------------------ mthomas's Profile: http://www.excelforum.com/member.php...o&userid=25649 View this thread: http://www.excelforum.com/showthread...hreadid=393138 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this
For i = 7 To lastRow If IsError(Cells(i, "L")) Then Cells(i, "L").Value.Clear End If Next i *** Sent via Developersdex http://www.developersdex.com *** |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have you tried altering your formula:
=If(Countif(lookupColumn,lookupValue)0,Vlookup(.. ...),"") this leaves the cell looking like it is blank. or you can change "" to 0, or ....... -- steveB Remove "AYN" from email to respond "mthomas" wrote in message ... I'm using paste/special to remove vlookup functions which leave #N/A when no matches were found. I'm not getting any errors but I can't get the current cell to clear if it has the #N/A. Can anyone assist? Thanks in advance! For i = 7 To lastRow If (CStr(Cells(i, "L").Value) = "#N/A") Then Cells(i, "L").Value.Clear End If Next i -- mthomas ------------------------------------------------------------------------ mthomas's Profile: http://www.excelforum.com/member.php...o&userid=25649 View this thread: http://www.excelforum.com/showthread...hreadid=393138 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I appreciate the replies guys, but just an FYI. I decided to use the replace method for the column and it worked great! Columns("D:D").Select Selection.Replace What:="#N/A", Replacement:="", _ SearchOrder:=xlByRows, MatchCase:=False Appreciate ya and thanks for the help.... -- mthomas ------------------------------------------------------------------------ mthomas's Profile: http://www.excelforum.com/member.php...o&userid=25649 View this thread: http://www.excelforum.com/showthread...hreadid=393138 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clear cells automatically | Excel Discussion (Misc queries) | |||
Cells.Clear | Excel Discussion (Misc queries) | |||
clear contents cells of unprotected cells | Excel Programming | |||
Clear Cells | Excel Discussion (Misc queries) | |||
Clear cells range if certain cells are all empty | Excel Programming |