This line of code is in Mr Excel's text VBA and Macro's Excel 2010 page 151.
It is in reference to storing a formula in a Name, and allows for a dynamic named column.
I am trying to understand what precisely this line of code is doing.
From what I can glean on the Net, the OFFSET function can take 3, 4 or 5 variables, depending on what the user wants.
The last 2 optional variables define how many rows and columns of data the user wants the function to return. I assume this would be the equivalent to a Resize function.
I also understand from the Net that the COUNTA function returns the amount of cells in a column that contain data.
Am I correct on both assumptions?
If I am does that mean the line of code above uses 4 variables being:
a. The starting cell is Sheet2, cell A2
b. The function moves moves 0 rows
c. The function moves 0 columns
d. The function returns the amount of rows defined by the amount of cells in Sheet2, Column A?
And then the code refers all this back to a Name called ProductList?
Is that all accurate?
It is in reference to storing a formula in a Name, and allows for a dynamic named column.
Code:
Names.Add Name:="ProductList", RefersTo:="=OFFSET(Sheet2!$A$2,0,0,COUNTA(Sheet2!$A:$A))"
From what I can glean on the Net, the OFFSET function can take 3, 4 or 5 variables, depending on what the user wants.
The last 2 optional variables define how many rows and columns of data the user wants the function to return. I assume this would be the equivalent to a Resize function.
I also understand from the Net that the COUNTA function returns the amount of cells in a column that contain data.
Am I correct on both assumptions?
If I am does that mean the line of code above uses 4 variables being:
a. The starting cell is Sheet2, cell A2
b. The function moves moves 0 rows
c. The function moves 0 columns
d. The function returns the amount of rows defined by the amount of cells in Sheet2, Column A?
And then the code refers all this back to a Name called ProductList?
Is that all accurate?