Why are you setting the (undeclared) range variable target and then not using it? Maybe you could explain in words what you're trying to do.