+ Reply to Thread
Results 1 to 9 of 9

hide column on double clicking certain cell

  1. #1
    Registered User
    Join Date
    10-24-2008
    Location
    netherlands
    Posts
    35

    hide column on double clicking certain cell

    Hi Experts,
    I want to hide and unhide column AI by double clicking on a certain cell, let's say S25. Can this be done?
    Greetings, Bengtar
    Last edited by bta; 02-01-2009 at 10:40 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: hide column on double clicking certain cell

    bta, yes you can use the Before DoubleClick event on the sheet in question.

    In native XL right click on the tab you wish the code to fire against, select View Code and insert the below into the resulting window:

    Please Login or Register  to view this content.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: hide column on double clicking certain cell

    Try this
    Please Login or Register  to view this content.
    Last edited by royUK; 02-01-2009 at 07:48 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: hide column on double clicking certain cell

    Another slight differentr version

    'These instructions pre typed & are worded to cater for the novice programmer
    'To install macro to correct location

    'Copy this macro
    'GoTo Excel
    'Select sheet this is to appy to
    'Right Click on Sheet Name Tab > select View Code
    'Past macro into the Worksheet Module displayed

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: hide column on double clicking certain cell

    Note, as per my example, if the double click action on S25 is purely to toggle column visibility be sure to use Cancel = True on the event itself
    (else you will be in Edit Mode on the Target).

  6. #6
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: hide column on double clicking certain cell

    DonkeyOte

    thanks for pointing that out I forgot about that little trap

  7. #7
    Registered User
    Join Date
    10-24-2008
    Location
    netherlands
    Posts
    35

    Re: hide column on double clicking certain cell

    Could this also be possible with a single click?

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: hide column on double clicking certain cell

    There is no single click event, you could use the BeforeRightClck event

  9. #9
    Registered User
    Join Date
    10-24-2008
    Location
    netherlands
    Posts
    35

    Re: hide column on double clicking certain cell

    Thank you all!

+ 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