I try to unhide columns using this:
Range(Target, Target.SpecialCells(xlCellTypeLastCell)).EntireColumn.Hidden = False
Only columns A
and B
in the sheet are visible, others - hidden, although there are values entered in A:K
. Target
can be any cell in column A
(this is a snippet from an event code).
How to unhide cells?
A:K
)-UsedRange
orxlCellTypeLastCell
should work for that. First I tried the latter, but obviously that does not work and I don't know why.When I debug, I see thatxlCellTypeLastCell
refers to a cell inB
column. However, I have achieved what I wanted by employingUsedRange
which does not ignore hidden columns. – ZygD