+ Reply to Thread
Results 1 to 7 of 7

Find Text

  1. #1
    Registered User
    Join Date
    11-19-2005
    Posts
    20

    Question Find Text

    Have Text In Column A, Need Vba Code To Find Cell With Matching Text In Another Workbook. Can Anyone Help Please.

  2. #2
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    here is a start - this was written to go down a column (the colkm) of text row by row (the j) and find the text in that cell in a range on a different sheet. You would need to switch back and forth between workbooks as well as sheets.

    without knowing more of what your are dealing with it is difficult to help more.

    Please Login or Register  to view this content.
    not a professional, just trying to assist.....

  3. #3
    Registered User
    Join Date
    11-19-2005
    Posts
    20
    Thanks Duane, have run out of time today. I will give it a try later & let you know how it went.

  4. #4
    Registered User
    Join Date
    11-19-2005
    Posts
    20
    Duane, maybe if I explain fully what I am trying to achieve you could help me.
    In workbook "REGO" I have registration numbers in cells A5111 to A5250.
    These registration numbers also reside in another workbook "DETAIL" somewhere in the range A2 to A8250.
    I am struggling trying to write a macro that that will find the text in "REGO" A5111 in the "DETAIL" workbook, copy all the cells to the right (B?? to AE??) and paste them into "REGO" at B5111. Looping through to "REGO" A5250.

  5. #5
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    try this - I have not testted or debugged though

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-19-2005
    Posts
    20
    Duane, the macro falls over at, "mytext = Sheets("sheet1").Cells(j, 1).Text" with run-time error 1004 - application-defined or object-defined error.
    Also question: The "DETAIL" workbook is actually .csv file ie. doesn't have sheets, what code to set the range in this file.
    Sorry to bug you again, but as you've no doubt gathered I'm new at this.
    Thanks....Peter

  7. #7
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    is the worksheet in the rego file actually named shet1? If not, replace sheet1 withthe correct sheet name. Same goes for my sheet2 references.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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