+ Reply to Thread
Results 1 to 10 of 10

Complex Task Macro

  1. #1
    Registered User
    Join Date
    08-09-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2003
    Posts
    34

    Complex Task Macro

    Hello,

    I am looking for help. I need help building a macro that will do the following:

    1. Create a list from a long range of names, removing duplicates.
    2. When a name from the created list is selected, copy and paste the assosciated columns with that person's name

    I have included an example spreadsheet. I have no idea where to start. Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    09-30-2013
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2007
    Posts
    229

    Re: Complex Task Macro

    I'm not 100% sure about the ask, but...

    To create the list
    1) Have input file sorted on name
    2) Have a comparison name variable initiated to blank (i.e.: Hold_Name)
    3) If the name you read is not the same as Hold_name then copy it to the new list and save name in Hold_name

    Please Login or Register  to view this content.
    The instructions in your sheet seem to be off. Tom doesn't seem to be associated with Steve at all.
    Do you want to use the 2nd list as a drop down to then display the information in sheet2?
    Last edited by alansidman; 09-30-2013 at 02:27 PM. Reason: added code tags

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Complex Task Macro

    @hectop

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (I have added this time. Please adhere to our rules in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    08-09-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Complex Task Macro

    Hey, sorry it was a typo. The file should only refer to Tom, not Steve. So when you pull down tom's name, it filters to a list of all of tom's employees for training.

    Edit: And you are correct. What I want is for the program to automatically create a list based on Sheet 2, and then when you pull one of the names down, to copy the information over that includes all of that person's employees.

  5. #5
    Forum Contributor
    Join Date
    09-30-2013
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2007
    Posts
    229

    Re: Complex Task Macro

    Sorry about that. Newbie mistake.

  6. #6
    Forum Contributor
    Join Date
    09-30-2013
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2007
    Posts
    229

    Re: Complex Task Macro

    You need 2 buttons and a drop down.
    1 button creates the named range that's used for the drop down list. Add this before the end sub of the code I posted earlier
    Please Login or Register  to view this content.
    Adjust the range to where ever you want to create the named range.

    Once you select the name from the named range, click on 2nd button to create the new list.

  7. #7
    Registered User
    Join Date
    08-09-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Complex Task Macro

    Ok, I went ahead and made the first button that makes the list "Names", with a dropdown. But the dropdown still displays multiple entries of the same name. I was confused a bit on your directions for steps 2 and 3, so that may have been addressing that issue.

    Also, is that 2nd string of code for the 2nd button that would copy the data B2:F16 in the example with Tom?

  8. #8
    Registered User
    Join Date
    08-09-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Complex Task Macro

    The whole idea behind this is to make finding information easier. The way it is now I have over 300 people filtering to their name and then copying out the information they need.

    What I would like is for them to click a button that simply copies and pastes the data for them on the main page, once they have selected the name they want.

  9. #9
    Forum Contributor
    Join Date
    09-30-2013
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2007
    Posts
    229

    Re: Complex Task Macro

    In your drop down you need to indicate that Source contains =Names.
    Here's the VBA code that will do the work
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Complex Task Macro

    gregpl,

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. [SOLVED] IF contingent task closed, THEN change formatting of dependent task cell
    By tek_9 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-29-2012, 08:40 PM
  2. Previous Task and Next Task buttons aren't working
    By top.C.Crets in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-07-2012, 08:27 AM
  3. [SOLVED] a complex task
    By TUNGANA KURMA RAJU in forum Excel General
    Replies: 0
    Last Post: 01-08-2006, 03:10 AM
  4. [SOLVED] dialog box for active cell task to speed repeditive task
    By Todd F. in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-09-2005, 10:05 AM
  5. Complex programming task
    By dvonj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-13-2005, 06:06 AM

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