Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Deleting #N/A

I am trying to delete the #N/As leftover after converting
a failed lookup function to a value. When the loop lands
on a cell that is #N/A when I perform the following:

Do Until ActiveCell = "Done"
If ActiveCell = "#N/A" Then
Selection.ClearContents
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Loop

I get a type mismatch error. Help says that "Variable
names must begin with an alphabetic character".

Do I need to change the variable type, or how do I do fix
this? Any help would be appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Deleting #N/A

Hi Merlin

try
Do Until ActiveCell.Text = "Done"
If ActiveCell.Text = "#N/A" Then
ActiveCell.ClearContents
End If
ActiveCell.Offset(1, 0).Select
Loop

Cheers
JulieD


"Merlin" wrote in message
...
I am trying to delete the #N/As leftover after converting
a failed lookup function to a value. When the loop lands
on a cell that is #N/A when I perform the following:

Do Until ActiveCell = "Done"
If ActiveCell = "#N/A" Then
Selection.ClearContents
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Loop

I get a type mismatch error. Help says that "Variable
names must begin wit hanalphabeticcharacter.

Do I need to change the variable type, or how do I do fix
this? Any help would be appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Deleting #N/A

I suggest using the if iserror function in the lookup.
example below

=IF(ISERROR(VLOOKUP(#REF!,CSR,2,FALSE))=TRUE,0,VLO OKUP
(#REF!,CSR,2,FALSE))

Regards,
-----Original Message-----
I am trying to delete the #N/As leftover after converting
a failed lookup function to a value. When the loop lands
on a cell that is #N/A when I perform the following:

Do Until ActiveCell = "Done"
If ActiveCell = "#N/A" Then
Selection.ClearContents
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Loop

I get a type mismatch error. Help says that "Variable
names must begin with an alphabetic character".

Do I need to change the variable type, or how do I do fix
this? Any help would be appreciated.
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Deleting #N/A

That worked! I should have thought of that, but I have
used iserror very little.
Thanks!!
-----Original Message-----
I suggest using the if iserror function in the lookup.
example below

=IF(ISERROR(VLOOKUP(#REF!,CSR,2,FALSE))=TRUE,0,VL OOKUP
(#REF!,CSR,2,FALSE))

Regards,
-----Original Message-----
I am trying to delete the #N/As leftover after

converting
a failed lookup function to a value. When the loop

lands
on a cell that is #N/A when I perform the following:

Do Until ActiveCell = "Done"
If ActiveCell = "#N/A" Then
Selection.ClearContents
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
Loop

I get a type mismatch error. Help says that "Variable
names must begin with an alphabetic character".

Do I need to change the variable type, or how do I do

fix
this? Any help would be appreciated.
.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting the text without deleting the formula gems04 Excel Worksheet Functions 3 January 30th 09 11:21 PM
Deleting cell data without deleting formula Tom Hall Excel Discussion (Misc queries) 4 October 29th 06 04:07 PM
deleting values in a worksheet without deleting the formulas patti Excel Worksheet Functions 1 October 28th 05 09:49 PM
how prevent formula in cell from deleting when deleting value???? sh-boom New Users to Excel 1 September 30th 05 06:12 PM
Deleting Hyphens or Dashes from multiple cells without deleting the remaining content rmaloy Excel Programming 5 February 9th 04 01:59 AM


All times are GMT +1. The time now is 05:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"