How to make a range reference in VBA (Macros) that updates when new data is added to it or data is removed from it.
I show you how to do this for regular ranges and also for Tables in the worksheet in Excel.
Worksheets("Data").Range("A2", "A" & Worksheets("Data").Range("A" & Rows.Count).End(xlUp).Row).Select
Data is the worksheet that contains the range.
A2 is the start of the Range.
(Explained in more detail in the video above.)
Worksheets("Data").ListObjects("tblColors").DataBodyRange.Select
Data is the worksheet that contains the Table.
tblColors is the name of the Table.
(Explained in more detail in the video above.)
Selecting and Activating Cells (microsoft resource)
How to Select Cells/Ranges (microsoft resource)