Variable Value within Range

Hamid Osmanov 21 Reputation points
2022-07-14T19:13:37.99+00:00

Hello,

I am trying to create a dynamic range by adding value of variable within range but it doesn't work.

Dim LastRow as Long
LastRow = Sheet2.Range("F1"). Current.Rows.Count + 1

........
Range("F&"+LastRow+"").Select
........

Do I add variable correctly to the range?220858-img-20220714-2109522.jpg220846-img-20220714-211026.jpg

I'd really appreciate if someone reviews the screenshots and helps me to understand what I am doing wrong. I need to add the same variable value to the "Data!R1C1:R1000C2" range instead of static"1000"

Many thanks in advance.

Regards.

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,318 questions
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 110.1K Reputation points
    2022-07-15T05:30:26.453+00:00

    Try this: Range("F" & LastRowDuplicates).Select.

    And this: "Data!R1C1:R" & someVariable & "C2".

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful