+ Reply to Thread
Results 1 to 4 of 4

Use FIND in VBA for complex search

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Use FIND in VBA for complex search

    Hi All,

    Just a quick scenario:
    Say in column C I have following list:
    1LAA80
    1LAA90
    1LAB60
    1LAC10
    1LC010
    1LC280
    1LC380
    1LC710
    4AA110
    4AA110

    My first problem then is that the macro should only look for the cells which start with 1LC.
    The second problem then would be that on the lines where he finds 1LC it should look in column F if there is an amount/value.
    Third step then would be that if there is an amount it should go to column H of that line and there put some formula (or word, does not matter that I can do just need to get the macro there)

    Since this is smaller part of the list you understand it has to be a variable "loop" of some sort which goes thru column C in search for codes which start with 1LC.

    Hope I explained good enough and hope the experts in this forum can help me
    Thanks in advance.

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Use FIND in VBA for complex search

    This should do it

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

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

    Re: Use FIND in VBA for complex search

    Try this code - copy it into a standard module -
    Please Login or Register  to view this content.
    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]

  4. #4
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Use FIND in VBA for complex search

    Thanks Mike!
    Had to do a small correction as I had not mentioned to you that column F would not be empty but 0 (so <> 0 instead of <>"").
    But works great and its a big help

    Arlette also a big thanks. Your method (with same small adjustment) also worked like a charme

+ 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