0

So I have the variable tstrng in a For loop and I want to set it equal to Columns C to Z at row "i", i being defined by the for loop iteration. I wrote the definition like this but the range keeps coming up as being empty and throwing a Runtime error. Any help on this issue would be greatly appreciated.

tstrng = wb1.Sheets("SourceData").Range("C" & i, "Z")

1 Answer 1

1

Try: tstrng = wb1.Sheets("SourceData").Range("C" & i, "Z" & i)

If i is 1 that will set tstrng to Range C1:Z1 in your SourceData worksheet.

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.