Share via

Filter using a drop-down list.

Anonymous
2024-06-10T07:40:50+00:00

I have a sheet that I want to filter using a drop-down list. Column A is what I want to filter the sheet by which is a column with the appropriate week number and the drop-down list I want to use is on cell B2. I tried using an advance filter but it was only filtering once and whenever I changed my selection on the drop-down list, the filter wouldn't update. I am a complete beginner, and all the answers I have seen were to complicated with code which I tried changing to my specific case but nothing worked.

![](https://learn-attachment.microsoft.com/api/attachments/3c52b9ef-4f86-45b8-ae30-dabaa68ce008?platform=QnA

Microsoft 365 and Office | Excel | For home | MacOS

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Anonymous
    2024-06-11T07:45:06+00:00

    Hello, Ahmed Dawood

    Crafting VBA solutions requires a tailored approach, as the complexity of your spreadsheet directly influences the intricacy of the VBA code. For specialized assistance, it’s recommended to pose your questions in a community dedicated to VBA expertise: Newest 'vba' Questions - Stack Overflow. While Microsoft Community is a valuable technical forum, it does not specialize in VBA.

    Disclaimer: Microsoft provides no assurances and/or warranties, implied or otherwise, and is not responsible for the information you receive from the third-party linked sites or any support related to technology.

    Rest assured, your inquiries within Microsoft Community will be maintained, allowing others to contribute and benefit from the shared knowledge.

    Yuhao Li

    Microsoft Community Technical Support

    0 comments No comments
  2. HansV 462.6K Reputation points MVP Volunteer Moderator
    2024-06-10T14:07:24+00:00
    0 comments No comments
  3. Anonymous
    2024-06-10T13:34:38+00:00

    Thank you for your reply. I tried using the Filter() function and I would like to keep the formatting the same way it is now. How can I use VBA to do this?

    0 comments No comments
  4. HansV 462.6K Reputation points MVP Volunteer Moderator
    2024-06-10T09:49:05+00:00

    Why not select A2:A218 and select Sort & Filter > Filter on the Home tab of the ribbon?

    This will display a drop-down list in A2, and selecting a week from the drop-down will automatically select the desired rows.

    0 comments No comments
  5. Anonymous
    2024-06-10T09:23:22+00:00

    Hello, Ahmed Dawood

    Welcome to Microsoft Community.

    Thank you for reaching out and sharing your Excel table with us. I understand that you’re starting your journey with Excel, and I’m here to assist you every step of the way.

    You’re absolutely right; there are straightforward methods to filter data in Excel, such as using the filter options available in Excel or the FILTER function (What is FILTER Function - Microsoft Support). However, these methods work best when applied to a range of cells without any merged cells.

    In the table you’ve provided, I noticed that there are numerous merged cells. This is important because simple filtering methods like filter options and the FILTER function may not work effectively in such cases. When cells are merged, it limits the functionality of these features, and we might need to resort to using VBA, which is the coding aspect of Excel you mentioned.

    If you prefer to use the simpler methods for filtering data, you would need to reorganize your table by unmerging any merged cells. This will allow you to take full advantage of Excel’s filtering capabilities without delving into VBA.

    Should you need further assistance with reorganizing your table or exploring how to use VBA, please don’t hesitate to let me know. I’m here to help make your Excel experience as smooth and efficient as possible.

    Yuhao Li

    Microsoft Community Technical Support

    0 comments No comments