1

I have the following Dims

Dim PlayersStartAt As Integer
Dim PlayersEndAt As Integer

PlayersStartAt = 101
PlayersEndAt = PlayersStartAt + 50


Selection.AutoFill Destination:=Range("B & PlayersStartAt:B & PlayersEndAt"), Type:=xlFillDefault

and want to execute the following line of code.

It with great with Range("B101:B151");

What is wrong with my syntax?

1 Answer 1

3

Change this

Range("B & PlayersStartAt:B & PlayersEndAt")

to

Range("B" & PlayersStartAt & ":B" & PlayersEndAt)

PlayersStartAt and PlayersEndAt are variables. Anything that you put between quotes will be taken as a string :)

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.