
If UCase(Left(Cells(1, active_column).NoteText, 3)) = "HID" Then Selection.SpecialCells(xlLastCell).ActivateĪctive_column = ActiveCell.Column 'Starts search in last column currently in use. If hidden = 1 Then ' Change to "all" columns visibleĮlse ' Change to "selected" columns visible ' "last used" value, due to "Static" statement in Sub title ' initial value of hidden is zero if "first use" or Set actcell = ActiveCell ' Stores location of "active" cell
#Unhide a column in excel 2003 password
' Checks if Worksheet is initially Protected, asks for password if neededĭim active_column, actcell, hidden, protectedĪpplication.ScreenUpdating = False ' Runs faster & stops screen flickerĪctiveWorkbook.PrecisionAsDisplayed = FalseĪctiveSheet.Unprotect ' Needed to allow hiding/unhiding to occur ' letters "HID", that is any word such as "Hide", "Hidden", "Hiding", etc. ' Columns defined by cells in FIRST row having a COMMENT starting with the ' Toggles a pre-defined selection of columns as hidden or unhidden This needs to be removed.īy use of the Static definition the macro toggles between hidden and unhidden. NOTE - When creating a new cell comment some versions of Excel start the comment with the user's name. The comment should start with the characters HID, upper or lower case. For example I use this to hide some columns during printing.Īll that you need to do is add a Comment in Row 1 for any column that you wish to hide. If you regularly want to hide and unhide a pre-defined set of columns then the macro below could be used. You can also unhide columns by selecting the columns on both sides of those you want to unhide, right-clicking on the selected columns, and choosing Unhide from the resulting Context menu. Click Hide & Unhide and then click Unhide Columns.Select the columns on both sides of those that are hidden.To later unhide the columns, follow these steps: Excel does, however, leave a thick bar in the column header area to indicate where the hidden columns would normally appear. Notice, however, that the other columns do not change they still retain the same column labels. You can also hide columns by selecting those you want to hide, right-clicking on the selected columns, and choosing Hide from the resulting Context menu. Click Hide & Unhide and then click Hide Columns.Click the Format tool in the Cells group.Make sure the Home tab of the ribbon is displayed.Select any cell in the column (or columns) you want to hide.The column is not deleted its width is simply reduced to 0. Once a column is hidden, it will not be shown on the display or printed when you print the worksheet. Excel allows you to easily hide columns in your worksheet.
