+ Reply to Thread
Results 1 to 8 of 8

Thread: Macro to Modify Worksheet_SelectionChange

  1. #1
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    153

    Question Macro to Modify Worksheet_SelectionChange

    Hi Guys,

    I need a macro that puts this onto the worksheet:
     Worksheet_SelectionChange(ByVal Target As Range)
    
        If Not Application.Intersect(Target, Range(****See Note 1***)) Is Nothing Then
        hide/or show other named ranges below named range above 
        End If
    Note 1 - Named range
    Note 2 - I want to be able to stipulate which named ranges will show/ hide.

    one way i thought i could achieve this is by listing all the named ranges in order - then by having a 1 or 0 column next to these ranges to identify what is to be shown/ hidden.

    Im open to suggestions on other ways about achieving this

    regards
    Attached Files Attached Files
    Last edited by jordan2322; 01-09-2012 at 09:51 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Cochrane,Alberta
    MS-Off Ver
    XL 2003,2007,2010
    Posts
    6,843

    Re: Named Range and Worksheet Selection Change

    What are you trying to do?

  3. #3
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    153

    Re: Named Range and Worksheet Selection Change

    Ive reworded the question and uploaded an example file - please see
    regards
    Last edited by jordan2322; 01-09-2012 at 09:03 PM.

  4. #4
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    153

    Re: Macro to Modify Worksheet_SelectionChange

    .....bump

  5. #5
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,640

    Re: Macro to Modify Worksheet_SelectionChange

    You've not really answered the question - why do you need to do this?

    What is the purpose of the code, from what I can see you would be better using Custom Views
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  6. #6
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    153

    Re: Macro to Modify Worksheet_SelectionChange

    The workbook this code will be used in is a report viewer. output files from an external program are copied and pasted into newly created worksheets in this workbook. All of the copied data is in named ranges. I want to have a macro run that will insert this code in so that the users of this report viewer workbook are easily able to toggle the view in the report. By toggle view I mean toggle the named ranges.

    Hope this helps
    Last edited by jordan2322; 01-10-2012 at 05:59 AM.

  7. #7
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,640

    Re: Macro to Modify Worksheet_SelectionChange

    That's totally different fromwhat you originally asked & the error trapping will not work that way
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  8. #8
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    153

    Re: Macro to Modify Worksheet_SelectionChange

    roy,

    Do you know of any other way to do this?

    thnx

+ 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.2.0