GfK #1 You're using X twice - its defined in your constant at the top, and also in your For/Next loop. That's probably what the problem is.