+ Reply to Thread
Results 1 to 9 of 9

Drop Down used to find and select sections

  1. #1
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Drop Down used to find and select sections

    I have a drop-down which is used to automatically go to a selected section in the worksheet. In this example I have Section 1, Section 2, Section 3, etc.
    It works quite well. There is just one part which I want to improve.
    Let's say I last selected Section 3, then later on I am in a different part of the workbook. I then select the same Section 3. It doesn't work. It only works if the selection is different to the last one (anything other than Section 3).

    Notes on Drop Down:
    The mechanics are better explained by viewing the attached workbook.
    The input data is saved a part of the worksheet coloured yellow. There is a section list, the selection made and the index of the selection. All 3 parts are given names.
    The drop down then has the following parameters: Right-click, Input tab ... Input range = the selection list, Cell link = index of the selection.


    Assigned macro to drop-down
    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Drop Down used to find and select sections

    The macro is called when there is a change to the dropdown's list index (the selected item). The easiest solution is to have the macro reset the list index. So when you reselect the same item, it triggers a change.

    Please Login or Register  to view this content.
    Another way to write the macro...
    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 09-22-2018 at 02:06 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Drop Down used to find and select sections

    Hello Un-Do Re-Do,

    Your Code works as it should. You don't say what you want it to do differently. Please upload a Workbook showing us a before and after scenario. In other words, explain what should happen when you are in another section of the Spreadsheet, and then select the same number from the DropDown?

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Drop Down used to find and select sections

    @AlphaFrog:
    Thanks for solving this.
    I was hoping the current selection remained in the drop-down ... but in thinking about it, I don't think it would be possible, would you agree?
    Otherwise I don't think it can be taken further.
    Thanks.

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Drop Down used to find and select sections

    @Winon
    the issue is...
    Select a section in the drop down. The code goes to that section
    Now select any other cell.
    Then re-select the same section in the DropDown. The code doesn't reselect that previously selected section.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Drop Down used to find and select sections

    Quote Originally Posted by Un-Do Re-Do View Post
    @AlphaFrog:
    Thanks for solving this.
    I was hoping the current selection remained in the drop-down ... but in thinking about it, I don't think it would be possible, would you agree?
    Otherwise I don't think it can be taken further.
    Thanks.
    You're welcome.

    This will keep the current selection text. IMO it would confuse the user.

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Drop Down used to find and select sections

    Thx once more.
    Works as intended.

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Drop Down used to find and select sections

    @ AlphaFrog,

    Thanks for clearing the confusion for me, Buddy.

    Glad to see you managed to solve the issue, well done!

    Regards.

  9. #9
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Drop Down used to find and select sections

    AlphaFrog, I've been using your code for a while now and it works really well.

    To summarise, the drop down is used to go to a selected section in the worksheet by using "Find".
    The default way it worked was that if a selection is made (say "48 Section"), then if the same selection is made later on, it doesn't go that that cell. This may be because a change is required to make the macro run.
    The new method clears the selection and you can now go to the same selection later on.
    More info in original post.

    With the new method, if there are a lot of sections, it goes back to the start.

    Would it be possible to keep some of the functionality from the original method. See attachment.

    1. Start on previous section for next choice.
    2. Highlight previous choice.

    Untitled.png

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 6
    Last Post: 01-18-2018, 08:03 PM
  2. Replies: 0
    Last Post: 03-16-2016, 06:34 PM
  3. Find average, min and max of sections of data in a column?
    By excel12121 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-26-2014, 07:58 AM
  4. Drop down control multiple note sections
    By dcaldwe8 in forum Excel General
    Replies: 15
    Last Post: 08-27-2014, 12:20 AM
  5. Replies: 3
    Last Post: 02-26-2012, 03:48 AM
  6. Excel 2007 : find sections of text within mulitple urls
    By CantonMassive in forum Excel General
    Replies: 4
    Last Post: 12-02-2011, 07:45 AM
  7. How to cut sections out of the Find results.
    By nondescriptcitizens in forum Excel General
    Replies: 2
    Last Post: 09-23-2010, 06:42 PM

Tags for this Thread

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