+ Reply to Thread
Results 1 to 5 of 5

Assigning a macro to a specific cell

  1. #1
    Registered User
    Join Date
    02-09-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Assigning a macro to a specific cell

    Can anybody help me?

    I have a cell which is linked to a data validation source. The options available are a range of numbers, and then finally 'Other'.

    What I'm looking to do is for a macro to run when the option 'Other' is chosen.

    This macro would then unhide a selection on the same worksheet, that at other times would remain hidden.

    I'm sure there must be a way, but I can't work out how to do it.

    Thanks
    Kevin

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Assigning a macro to a specific cell

    Hello,

    a macro along these lines, maybe?

    Please Login or Register  to view this content.
    Change the A1 to the cell you want to monitor. Adjust the section you want to unhide.

    cheers,

    -------------

    Worksheet event code is stored on a worksheet module. To add it to your worksheet, do the following:

    Copy the code
    Select the worksheet in which you want the code to run
    Right click on the sheet tab and choose View Code, to open the Visual Basic Editor.
    Where the cursor is flashing, choose Edit | Paste

  3. #3
    Registered User
    Join Date
    02-09-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Assigning a macro to a specific cell

    Hi teylyn,

    Works perfectly thanks.

    Is it also possible to reverse this when they alter the selection from 'Other' to a number in the drop down list?

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Assigning a macro to a specific cell

    Sure, something like

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-09-2012
    Location
    Southampton, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Assigning a macro to a specific cell

    Perfect!! Happy days!

+ 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