View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] jeremy.haynie@gmail.com is offline
external usenet poster
 
Posts: 6
Default Need help...vlookup "type mismatch"

So...my goal is to write a macro that will copy-paste values on all
cells in a selection that a vlookup returns a value 0...and leave
the formula in the rest.

I get a type mismatch with the following code because of the vlookup
formula (even when a value is returned)

For Each cell In Selection
If cell.Value 0 Then
cell.Copy
cell.PasteSpecial Paste:=xlValues
Next cell
Application.CutCopyMode = False



any suggestions?