+ Reply to Thread
Results 1 to 7 of 7

Hide a column by clicking on a cell or using a hot key?

  1. #1
    Registered User
    Join Date
    02-25-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    57

    Hide a column by clicking on a cell or using a hot key?

    Is it possible to hide a column by either clicking on a unused cell or by defining & pressing a hot key, say F10?

    I'm not up at all on any of the coding in Excel so would appreciate any advice, pointers or links.
    Thanks

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Hide a column by clicking on a cell or using a hot key?

    Hi,

    F11 will take you into the Visual Basic Environment (VBE).
    In the Project Explorer window on the left select your workbook.
    From the menu choose 'Insert Module'
    In the big code window on the right copy and paste the following macro
    Please Login or Register  to view this content.
    Now close the VBE.
    Select Tools Macro Macros, Select the HideColumn macro, Choose Options, in the Shortcut key enter say 'h' for hide.

    Now whenever you click Ctrl-h the column for the active cell will be hidden.

    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor Rahul Nagar's Avatar
    Join Date
    09-18-2008
    Location
    nasik
    MS-Off Ver
    Excel 2003
    Posts
    465

    Re: Hide a column by clicking on a cell or using a hot key?

    Hello,

    "CTRL+9" - Hides the selected rows.
    "CTRL+0" - Hides the selected columns.
    "CTRL+(" - Unhide any hidden rows within the selection.
    "CTRL+)" - Unhide any hidden columns within the selection.

    Rahul

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Hide a column by clicking on a cell or using a hot key?

    Hi Rahul,

    Thanks for reminding me. I'd forgotten that much simpler solution!

    Rgds

  5. #5
    Registered User
    Join Date
    02-25-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    57

    Re: Hide a column by clicking on a cell or using a hot key?

    Hi

    Thanks for the quick replies.

    Re the code Richard, is their anyway to use that & when CTRL+H (or pref a F key) is hit it will hide the specified column, which in this case is Column O.

    Just I want this column hidden fairly quickly at times due to prying staff eyes & then having to click the column 1st, remeber the shortcut combo etc?

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Hide a column by clicking on a cell or using a hot key?

    Hi,

    Yes just use
    Please Login or Register  to view this content.
    I'm not aware that you can use the dedicated Fnn keys since they perform actions defined by the applications/computer

    HTH

  7. #7
    Registered User
    Join Date
    02-25-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    57

    Re: Hide a column by clicking on a cell or using a hot key?

    Hi

    That's all working fine, thanks, however it's only working on one sheet, despite copying the code to the next sheet so its all identical?
    Looking at Macros again it has added a new Hide Column relating to Sheet64. I have editied that with the same CTRL+H but when CTRL+H is used it only hides the column that has an active cell, not my Column O?

    Also is their away to bring the hidden column back using the same CTRL+H or is their another shortcut that will bring them back without having to highlight columns & right clicking?

    Thanks
    Last edited by simonwilliams; 12-02-2009 at 07:23 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1