vba - When trying to read #NAME? Value from excel to a string gives Type mismatch error -


i have macro reads description string excel , finds out particular string present in data or not.

sometimes input file might contain value #name? in cell. when macro reaches cell gives error type mismatch run time error 13 on following line.

i wanted ignore line , continue next line. how should give validation (if). i'm using 'do- loop until' loop. descriptionstring string variable.

descriptionstring = currentwrkbk.worksheets(1).cells(i, 1).value 

use iserror, so

if iserror(currentwrkbk.worksheets(1).cells(i, 1).value))....


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -