+ Reply to Thread
Results 1 to 15 of 15

Macro to search

  1. #1
    Registered User
    Join Date
    05-31-2018
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    34

    Macro to search

    So I am trying to figure out how to make a search macro where you can select dates (each date is in worksheet) copy and paste the row to the cover page. excluding all "give-up" entry. The search will only be the letters in the front of symbol column (H) not the numbers.

    [SOLVED]
    Attached Files Attached Files
    Last edited by DAxel1259; 06-19-2018 at 04:28 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Macro to search

    Hello DAxel1259,

    See if the attached workbook does what you want. I have included the code here for those who are interested.

    Module1 Macro Code
    Please Login or Register  to view this content.
    Search Worksheet Macro Code
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    05-31-2018
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    34

    Re: Macro to search

    It's perfect, but there is one issue I imported some June data but its not recognizing it, it stops on May 31st.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Macro to search

    Hello DAxel1259,

    Should not be an issue. Did you name the new sheets "Jun 1" or "June 1". The macro is set for a 3 letter month and not the full month name. Easy enough to change if you need me to.

  5. #5
    Registered User
    Join Date
    05-31-2018
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    34

    Re: Macro to search

    Its set up on JUN right now, the search goes to may 31st and ends, not sure why.

  6. #6
    Registered User
    Join Date
    05-31-2018
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    34

    Re: Macro to search

    Nevermind I got it to work Just needed to add a second d to mmm-d-yyyy to mmm-dd-yyyy. Thank you so much

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Macro to search

    Hello DAxel1259,

    Nice work on the fix. Glad I could help.

  8. #8
    Registered User
    Join Date
    05-31-2018
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    34

    Re: Macro to search

    What would happen if the format of the data changed? Say if the date column was on the AC Column?

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Macro to search

    Hello DAxel1259,

    You would need to expand your search range in the macro from columns "A:T" to columns "A:AC" or I can change the the macro to use the columns in the header roe as the columns to be searched.

  10. #10
    Registered User
    Join Date
    05-31-2018
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    34

    Re: Macro to search

    Im trying to use the macro on a data set where the search portion is column R, there arent any dates on column A, the Date column is AC and the data goes to CG. Also what would happen if the tabs were renamed to MMM DD YYYY ? do the Tabs also have to be in order for the macro to work?

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Macro to search

    Hello DAxel1259,

    The macro was written to work with the your original layout. If you have changed the layout then the macro code must be changed also.

  12. #12
    Registered User
    Join Date
    05-31-2018
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    34

    Re: Macro to search

    Is minor changes? could you help? also don't need to give-up portion anymore.

  13. #13
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Macro to search

    Hello DAxel1259,

    Can you post a copy of the new workbook?

  14. #14
    Registered User
    Join Date
    05-31-2018
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    34

    Re: Macro to search

    Here is a desensitized file
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    05-31-2018
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    34

    Re: Macro to search

    Thread Bump

+ 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. Search and copy macro with search criteria
    By richlilrich in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-26-2016, 11:40 AM
  2. VBA Macro to Search a Website's Search-Box
    By unit285 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-06-2015, 02:35 PM
  3. Creating search box in cell - Currently using Macro 'Range to search' *HELP*
    By jacko058 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-14-2014, 05:24 AM
  4. [SOLVED] Macro/s to create Search Bar to filter to search terms entered activated by Command Button
    By JasonRay in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-08-2013, 03:44 PM
  5. Linking Search Results from an existing search macro
    By mougiasm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2013, 04:15 PM
  6. [SOLVED] Macro to search a string, then search above for another one and copy the rows between them
    By DarKDjinni in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-20-2012, 09:36 PM
  7. [SOLVED] Macro ignores search code when 1 of the 2 search parameters is not found
    By BrodyNoochie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-25-2012, 05:21 PM

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