+ Reply to Thread
Results 1 to 6 of 6

Code to Locate Numbers and Write Results

  1. #1
    Registered User
    Join Date
    09-09-2018
    Location
    Vancouver, canada
    MS-Off Ver
    2010
    Posts
    76

    Code to Locate Numbers and Write Results

    I need the to locate numbers 1 TO 10 in MANY cell ranges, example only D3:D12, H3:H12, L3:L12 (I will need to be able to add additional ranges to the code, this is only an example). I have a sample Excel sheet at the end to visually see the details below.

    A positive result would be a "*#-#*" in the column to the right of 1 to 10 numbers and also numbers in the second column to the right of the 1 to 10 numbers. Once numbers are found and have a positive result the numbers in the second column are to be written (do not delete after the write) to the following cells (again please make these cells changeable):

    (1 to 10 are the search numbers)

    1 to cell B3
    2 to cell B4
    3 to cell B5
    4 to cell B6
    5 to cell B7
    6 to cell B8
    7 to cell B9
    8 to cell B10
    9 to cell B11
    10 to cell B12

    I need the code to add all numbers in the cells, example from my Excel sheet is number 5 is found in cell D3 would write 10.00 to cell B7 and also cell L12 has a 5 and a 2.00 in which would be written to cell B7 (10.00 plus 2.00 = 12.00).

    Using my sample Excel sheet has sample data and the expected result highlighted in yellow.

    That would do it. Thanks so much for all your help.

    LOCATE NUMBERS.png

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Code to Locate Numbers and Write Results

    I am sorry

    I read this twice. It makes no Sense
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    09-09-2018
    Location
    Vancouver, canada
    MS-Off Ver
    2010
    Posts
    76

    Re: Code to Locate Numbers and Write Results

    Hi

    Just a quick summary using my Excel sample:

    - Find numbers 1 TO 10 in cell ranges, example only D3:D12, H3:H12, L3:L12 (don't hard code, have to add additional ranges). So lets do the first find cell D3 with a 3 in it and also a 1-1 in cell E3 and 10.00 in cell F3 (a positive result). Cell D4 would normally have a number in the cell (1 to 10, my fault here) but their is no set of numbers in cell E4 and no numbers in cell E5 so be not be a positive result.

    - Positive results D3 (first positive one), using the numbers in cell F3 would get written to cell B7 and so on.

    Hope this helps.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Code to Locate Numbers and Write Results

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-09-2018
    Location
    Vancouver, canada
    MS-Off Ver
    2010
    Posts
    76

    Re: Code to Locate Numbers and Write Results

    Hi

    Thank-you for your code. Your note on if there is a match what to do should be done is to write the numbers (if more then number is found then it should add to the existing amount) to the following cells:

    Number 1 to cell B3
    Number 2 to cell B4
    Number 3 to cell B5
    Number 4 to cell B6
    Number 5 to cell B7
    Number 6 to cell B8
    Number 7 to cell B9
    Number 8 to cell B10
    Number 9 to cell B11
    Number 10 to cell B12

    Thanks so much for your help.
    Scott

  6. #6
    Registered User
    Join Date
    09-09-2018
    Location
    Vancouver, canada
    MS-Off Ver
    2010
    Posts
    76

    Re: Code to Locate Numbers and Write Results

    Could you close this posting. My helper is gone.
    Thank-you

+ 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 Locate Numbers and Write Location
    By scott1945 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-22-2019, 01:21 PM
  2. [SOLVED] Modify Myrna Larson's code to write results in rows
    By BnCo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-17-2019, 07:17 PM
  3. [SOLVED] Code to write numbers from one cell to another
    By scott1945 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 12-02-2018, 05:51 PM
  4. how can i write vba code for replacing continuos fraction numbers in on row
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 06-21-2014, 08:04 AM
  5. [SOLVED] How to search one item in Excel and locate many results?
    By RaMubara in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-17-2014, 06:55 AM
  6. Locate two equal numbers in an array of numbers
    By avveerkar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2010, 01:22 AM
  7. [SOLVED] Wanting to write results to array instead of sheet, results overwriting....
    By sarjuhindocha@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2005, 10:05 AM

Tags for this Thread

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