deniskellyelphin
New Member
- Joined
- Oct 30, 2018
- Messages
- 1
Hi, I would like to delete all columns that only contain Blanks, or "n/a".
I want a code that deletes based on whether the column contains anything other than a combination of a specific word e.g. "n/a" and/or trimmed Blank cells e.g. "" and/or " ". If it contains something else e.g. other text such as "Yes" or a Number etc., I don't want to delete that Column! However, in assessing if to delete a column, I want it to ignore the header row!
The data is in range A:CS with Header in A1:CS1. The number of rows will vary from file to file but can go up to A8:CS3489, but most data sets will have much less, circa A8:CS200, so I would like to incorporate xEndCol and End(xlUp).Row commands (if that is the right way of saying it!)
I can find a code online to delete columns and with multiple criteria and code to delete columns based on sole criteria ignoring header rows, but
can't figure out how to merge the two so that it works... (I'm only starting my VBA journey!)
Any help really appreciated.
I want a code that deletes based on whether the column contains anything other than a combination of a specific word e.g. "n/a" and/or trimmed Blank cells e.g. "" and/or " ". If it contains something else e.g. other text such as "Yes" or a Number etc., I don't want to delete that Column! However, in assessing if to delete a column, I want it to ignore the header row!
The data is in range A:CS with Header in A1:CS1. The number of rows will vary from file to file but can go up to A8:CS3489, but most data sets will have much less, circa A8:CS200, so I would like to incorporate xEndCol and End(xlUp).Row commands (if that is the right way of saying it!)
I can find a code online to delete columns and with multiple criteria and code to delete columns based on sole criteria ignoring header rows, but
can't figure out how to merge the two so that it works... (I'm only starting my VBA journey!)
Any help really appreciated.