Hi everyone!
I'm trying to select part of a table using VBA. Basically I'm using a loop to roll through each column of a table, and for certain columns I want to extract the body data (not the header), but only the cells that are populated. The cells will always be filled from the top, so I'm looking for row 2 to row x from the column. I have used the following formula to work out the number of items in the column (in this case 2 when excluding the header) out of the total column length of 10 plus the header.
r = Application.WorksheetFunction.CountA(Worksheets("Data").ListObjects("Scenario" & Scenario & "DC").ListColumns(i).Range)
How on earth do select row 2 to row 4 as a range to pull into a VBA array??
I'm trying to select part of a table using VBA. Basically I'm using a loop to roll through each column of a table, and for certain columns I want to extract the body data (not the header), but only the cells that are populated. The cells will always be filled from the top, so I'm looking for row 2 to row x from the column. I have used the following formula to work out the number of items in the column (in this case 2 when excluding the header) out of the total column length of 10 plus the header.
r = Application.WorksheetFunction.CountA(Worksheets("Data").ListObjects("Scenario" & Scenario & "DC").ListColumns(i).Range)
How on earth do select row 2 to row 4 as a range to pull into a VBA array??