+ Reply to Thread
Results 1 to 4 of 4

Need help to write a macro to search for a word or number in a column

  1. #1
    Registered User
    Join Date
    03-20-2014
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Need help to write a macro to search for a word or number in a column

    Hi,
    I am really stuck. I need help writing a macro to search for a word or number (that the user inputs so preferably as an input box) in 5 columns and if it appears in any of these columns then for that row to be copy and pasted into a new sheet. And then for the search to continue onto the next row so that any rows that have this search term are on the new sheet (there are 5000 rows). Any help will be greatly apprectiated!

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need help to write a macro to search for a word or number in a column

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Need help to write a macro to search for a word or number in a column

    This is how I read your problem
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-20-2014
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Need help to write a macro to search for a word or number in a column

    Hi, Thank you both for your suggestions. I really appreciate your responses. I have spent a lot of time trying to work the macros you suggested, however nothing gets copied into the new worksheet. Any suggestions?
    I. Procedures on Nervous System 1-28 Skull, Meninges and Brain 1 Examination of skull, meninges or brain 40803-00 Intracranial stereotactic localisation

    Basically there are 4 columns (as above) and 5000 rows. I need an input box where the user can search with anything from a word eg 'nervous' or a number eg '40803'. If the search term appears in the row then I would like the row to be copied and pasted onto sheet2. If this word appears more than once I would all the rows it appears in to be copied and pasted into sheet 2. I am not sure what the macros above are missing - perhaps a paste function? I'm not really familiar with complex macros. Thanks again for your help

+ 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: 2
    Last Post: 09-26-2013, 12:17 PM
  2. Replies: 5
    Last Post: 08-28-2013, 02:16 PM
  3. Replies: 2
    Last Post: 02-17-2012, 03:08 AM
  4. VLOOKUP - search only one word from long text & write
    By canada123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-22-2010, 09:57 PM
  5. seach specific word in column & write something different in next column
    By canada123 in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 02-05-2010, 05:09 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