I have a range (with 5 rows of data (and a top row for column headers). Column A is just a person's first name, and the remaining columns are labeled A through F. The cells in the grid will have a simple YES or NO, but not every cell is filled in for each person-- at some point, the cells will all start to all be blank. That point is different for different people.
I have code that builds this range as a table, but what I want to do with VBA is to start from the right (in Col F) and assess if none of the 5 people have any YES or NO entries listed in this column, HIDE the column and then check the next column to the left which would be column E. This would continue until it doesn't have a column to delete (because in the column being checked, at least one of the cells has a YES or NO value.)
In the file I've attached, the code would HIDE the E and F columns, but then it would END SUB since we do have a non-blank value in column D.
I've been unable to figure out the VBA for this, and you can't really do it with the recorder. It has to work with a different set of YES and NO values in the grid, since that will vary from day to day. Anybody have an idea?
My simple worksheet is with my Excel table attached if you need to see it.
I have code that builds this range as a table, but what I want to do with VBA is to start from the right (in Col F) and assess if none of the 5 people have any YES or NO entries listed in this column, HIDE the column and then check the next column to the left which would be column E. This would continue until it doesn't have a column to delete (because in the column being checked, at least one of the cells has a YES or NO value.)
In the file I've attached, the code would HIDE the E and F columns, but then it would END SUB since we do have a non-blank value in column D.
I've been unable to figure out the VBA for this, and you can't really do it with the recorder. It has to work with a different set of YES and NO values in the grid, since that will vary from day to day. Anybody have an idea?
My simple worksheet is with my Excel table attached if you need to see it.