+ Reply to Thread
Results 1 to 3 of 3

Excel VBA: Search multiple ranges for two specific above values and modify an offset cell

  1. #1
    Registered User
    Join Date
    01-11-2019
    Location
    Texas, United States
    MS-Off Ver
    Office 16
    Posts
    1

    Question Excel VBA: Search multiple ranges for two specific above values and modify an offset cell

    I'm currently creating an inventory list for several characters in a game. I'm trying to create an entry form above the inventory list that will search the list for if a character by that name is already carrying that item. If they are, it should add 1 to the Quantity Column. If not, it should add the data entered to the bottom of the list.

    Example in context of the image below:
    It should be testing cells A9 & B9 to find a match below them. So if the word spellbook is in B9 next to Adrys, it should find Adrys in A20 and Spellbook in B20, then change the quantity value in F20 to 2 by adding 1 to the existing 1. If it fails to find a match for both of those values (Adrys & Spellbook), it should add those value to the A & B cells at the very bottom of the list.
    Inventories.PNG


    I have been trying several different formulas, but I can never seem to get it (I'm quite new to this and only have a limited understanding. Don't even completely understand what my current formulas do).

    My attempted formulas so far that haven't even seemed to be able to create anything, including performing things like Debug.Print on a success, so I'm kinda stumped. Each formula is listed below in order of length. In addition, while some seem like they would return correct values, I don't know how to make them select that cell and then change a value in an offset cell. Any help would be appreciated.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Excel VBA: Search multiple ranges for two specific above values and modify an offset c

    Try

    Please Login or Register  to view this content.
    Kind regards
    Leo

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,236

    Re: Excel VBA: Search multiple ranges for two specific above values and modify an offset c

    Hi Jubdown

    Welcome to the forum...
    As per a snippet of your code...
    Please Login or Register  to view this content.
    If this is the amount of rows perhaps a filter could be more suitable than a loop..
    Another solution...
    This assumes that there will never be duplicates else what is the point...
    Please Login or Register  to view this content.
    Last edited by sintek; 01-13-2019 at 04:10 PM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ 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. [SOLVED] Excel VBA to hide multiple ranges based on specific cell values
    By Stuepef in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-30-2018, 01:07 PM
  2. Replies: 1
    Last Post: 11-14-2012, 01:33 PM
  3. Replies: 13
    Last Post: 10-31-2012, 05:06 PM
  4. [SOLVED] EXCEL MACRO: modify import multiple csv to start from a specific row
    By magdy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2012, 03:40 AM
  5. [SOLVED] Search worksheets for values that matches a cell and add different value to offset cells.
    By ANDREWA in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2012, 07:57 AM
  6. Replies: 1
    Last Post: 01-25-2011, 10:50 PM
  7. Sum values on specific date within a daterange (multiple ranges)
    By Fredrik S in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-26-2008, 05:47 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