Ok, this is about as stupid as it gets. I added a comment inline with a filter.add code and get the above error, see image. For a comment to generate an error means Excel is refusing to acknowledge the ' comment flag. That is a problem.
was attempting to modify code from: Filtering 2D Arrays in Excel VBA
and attempting to modify the filter.add lines to match my desired editing to my array.
I have my 1st filtered array based on column headers between 2 tables in 2 different workbooks. That is functioning great. Now I need to filter down 2 more times. I have no issues if this has to be performed by creating 2 more arrays. None of the data sets are overly large (should be less than 400x41 in dimension RowxColumn) to start with.
The first filter (City/Network) should bring that down to around 150x41. The last filter will reduce only if there are blank values in the column Group. In most cities that last filter will not happen so a 4th array will not be built.
Array 1: masterSheetArr(), created manually for now, will need to make this variable dependent on user form input later
Array 2: colSortedArr(), created manually for now, will need to make this variable dependent on user form input later
Array 3: will be citySoftedArr(), not created yet. no clue how to filter out a column for a (string in this case) and copy all data in that row to new array.
Array 4: if needed will be allGroupArr() -> or something along that line. This array will just filter out any row that has a blank cell in the group column to create the 4th array
Note: If i comment out the entire line starting at 'filter.add Excel accepts that comment, but is ignoring the inline comment. WTF?
was attempting to modify code from: Filtering 2D Arrays in Excel VBA
Setup the filter
Dim filter As New ArrayFilter
With filter
.name = "sam"
.category = "Medium"
.maxValue = 10
End With
Or
filter.add(1, "sam") 'column 1
filter.add(3, "Medium") 'column 3
filter.addMax(2, 10) 'column 2
Create the filtered data set
filteredArray = getFilteredArray(originalArray, filter)
The getFilteredArray is fairly straightforward to write: you loop over the array checking if the values match the filter and put the valid lines in a new array:
If filter.isValidLine(originalArray, lineNumber) Then 'append to new array
and attempting to modify the filter.add lines to match my desired editing to my array.
I have my 1st filtered array based on column headers between 2 tables in 2 different workbooks. That is functioning great. Now I need to filter down 2 more times. I have no issues if this has to be performed by creating 2 more arrays. None of the data sets are overly large (should be less than 400x41 in dimension RowxColumn) to start with.
The first filter (City/Network) should bring that down to around 150x41. The last filter will reduce only if there are blank values in the column Group. In most cities that last filter will not happen so a 4th array will not be built.
Array 1: masterSheetArr(), created manually for now, will need to make this variable dependent on user form input later
Array 2: colSortedArr(), created manually for now, will need to make this variable dependent on user form input later
Array 3: will be citySoftedArr(), not created yet. no clue how to filter out a column for a (string in this case) and copy all data in that row to new array.
Array 4: if needed will be allGroupArr() -> or something along that line. This array will just filter out any row that has a blank cell in the group column to create the 4th array
Note: If i comment out the entire line starting at 'filter.add Excel accepts that comment, but is ignoring the inline comment. WTF?