0
votes

I need to create a range of cells that will change for different persons names. For each person name I have the row and column numbers that will define the range, and this number are in some cells of the sheet.

For instance,

rows:

Cell(A5) = 3

Cell(A6) = 9

column:

Cell(A7) = 4 ----> (Column D)

so, the final range given by this set of rows and columns numbers is range("D3:D9"). For another person name I will have a different range given by some other numbers for rows and columns positions. The problem is that everyday new or existing people's names are added, so I cannot create a named range because it will change everyday. However, the values in cells A5/A6/A7 are capturing the new information for the location of the new range in different days.

I have tried to build this line of code, but it does not works:

Sub Dynamic_Range()

Dim rng As Range

Set rng = Range(Cells(Range("A5").Value, Range("A7").Value), Cells(Range("A6").Value, Range("A7").Value))

End Sub

Can someone advise on this?

What is not working? How are you planning on using it (a practical example)? Where are the names located? Where is the data for the next person? Add more detail, possibly a screenshot to your post.VBasic2008