Solved how to unhide the last column that contains text in VBA

July 29, 2016 at 13:51:51
Specs: Windows 7
VBA Question: Each worksheet in my workbook has a variable number of hidden columns which are at the end of the range. I need to be able to unhide the last hidden column, which will always have the heading 'text', so that it (and all hidden cols before it) will be included in a sort function. (Otherwise, only visible columns are included in the sort.) After I do the sort, I will need to re-hide the 'text' column. The location of the 'text' column will vary from sheet to sheet, but it will always be the last column containing text and it will always be initially hidden. The number of columns before it that are hidden will vary. I am just wanting to unhide the 'text' column, so that it (and all hidden columns before it) will be included in the sort function. Thank you very much in advance for any VBA assistance you can provide to accomplish this!

message edited by User444


See More: how to unhide the last column that contains text in VBA

Report •


#1
July 29, 2016 at 18:41:27
✔ Best Answer
Is the column that you need to unhide the only column with the heading "text"?

Is the "text" in Row 1?

If so, use the .Find method on Row 1 to find "text" and unhide the column that it is found in.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
July 29, 2016 at 20:03:04
Thank you for your suggestion, DerbyDad03, the code is working now!

Report •

Related Solutions


Ask Question