Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need help...vlookup "type mismatch"
For Each cell In Selection
if not iserror(cell) then If cell.Value 0 Then _ cell.formula = cell.Value end if Next cell -- Regards, Tom Ogilvy " wrote: 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
"Type mismatch" when I try to fill an Array variable with "+" | Excel Discussion (Misc queries) | |||
Error Handling to mitigate "Run Time Erorr 13 Type Mismatch" | Excel Programming | |||
"FIND" generates "Type mismatch" error | Excel Programming | |||
Copying data to another worksheet gives "Type Mismatch" error | Excel Programming |