+ Reply to Thread
Results 1 to 4 of 4

Search for specific code, add up. Then replete.

  1. #1
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Search for specific code, add up. Then replete.

    As you can see in this example there is a set of data contained in A1:AE32. With another set starting at A33-AE64. In this example there are only two but in the real version there could be 30 or 50…

    But I can tell you that there will NEVER be an empty cell between them so if you got A65 (for example) that’s the end of the data.


    I am trying to create a macro that will do the following:

    Start in AJ2 then start looking in Col B for that code (in this case its 5128).

    IF you find the code take the number two to the right (in this case the first one would be 1772), next would be 1778, next would be 1896, next would be (row 50) at 354, then 1772, then 1813.

    You would then need to search AGAIN in col E, then H, then K, then N, then Q, then T, then W, then Z, then finally AC…….. Then ADD up all the numbers and put it in this case……AL2. The total is: 9935.

    Then repeat this process for AJ3 and so on. Again AJ will be a list of say 30 or 40… but again if the maco encounters an empty cell…. Its done with the search.


    Thank you very much for your assistance with this.
    Attached Files Attached Files

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Search for specific code, add up. Then replete.

    This appears to work. Give it a try.
    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Re: Search for specific code, add up. Then replete.

    IT DOES WORK!!!! Thank you!!!!!

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Search for specific code, add up. Then replete.

    You're welcome,
    Regards, JLG

+ 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. Code to set specific Cells to be used in a combo box for a search criteria
    By larrysdime in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-30-2015, 10:09 AM
  2. Replies: 4
    Last Post: 12-02-2014, 05:17 PM
  3. [SOLVED] Code to Search a table for a specific Cell and fill it
    By JRidge in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-04-2014, 01:45 PM
  4. VBA Code - Search text & search number & search qty and result - Urgent Please
    By naresh73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2014, 10:51 AM
  5. VBA code to search a list for specific value
    By PonyKiller87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-29-2013, 03:50 PM
  6. [SOLVED] search for text in colB, starting with next row search for 1st occurrence of specific #
    By roothog in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-24-2012, 10:39 PM
  7. Changing Search Code From Numeric Specific
    By laffers in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2011, 06:10 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