2

I've looked but can't find a solution.

How do you increment a variable? Like in any other language you just do ++(variable name) just before the end of the loop. In my example, I'd like to increment J.

Dim j as integer
j = 13
FinalRow = Range("B15").End(xlUp).Row
        For i = 9 To FinalRow
            Range("B" & i).Copy Destination:=Sheets("Design").Range("A" & j)
            J++
        Next i

The code loops from B9-B15 and pastes the information in the Designsheet from A13 and downwards.

1 Answer 1

6

Just do this:

J = J + 1

Simples.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.