+ Reply to Thread
Results 1 to 4 of 4

Search Sheet2 Column A For Value In Textbox On Sheet1 Then Offset Right By 1-5 Column

  1. #1
    Registered User
    Join Date
    04-21-2009
    Location
    Puyallup, WA
    MS-Off Ver
    Excel 2010
    Posts
    55

    Search Sheet2 Column A For Value In Textbox On Sheet1 Then Offset Right By 1-5 Column

    Having trouble with a a macro. I have a search function that works just fine. It pulls information from Sheet2 and places the data (which will always be integers) in 5 cells on Sheet1.

    My problem is this: I have added buttons to the right (of the cells that hold the data on Sheet1) which needs to increment or decrement the left-most respective values up or down by one... which I can do but the hard part for me is...

    I then need to search in column A to find the value in the textbox/searchbox field and when found, I need to offset to the right (columns B, C, D, E, or F depending on the "Service n"). When offset and the cell is found, I need to update this value with the newly updated value created by clicking the up or down button (basically adding or subtracting 1 from this cell).

    Essentially, this is used to update a product SKU quantity. When one SKU is sold, I have the "Down" button there to update the inventory amount so I enter the SKU, Press Search, then find the service I want to decrement, press the "Down" button to the right when a SKU is sold, and it would decrement that SKU quantity on Sheet2 by 1 for that particular service.

    I hope I've explained it thoroughly. I'll send $5 to the first person's Paypal that can figure this out. I'm sure it's simple and I'm overlooking something. I told my girlfriend I could figure this out but I need some help fellas (and ladies)!


    If you have a minute, please have a peek at my attached Excel document for a clear idea of what I mean.
    Attached Files Attached Files
    Last edited by sweetrevelation; 11-07-2009 at 06:55 PM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Search Sheet2 Column A For Value In Textbox On Sheet1 Then Offset Right By 1-5 Co

    I believe that you can do this much more simply.

    Your Down sub can be

    Please Login or Register  to view this content.
    On the Sheet1 tab in the VBA editor add the following. You will need to create the other up and down versions of this.

    Please Login or Register  to view this content.
    I hope that this gets you started.
    Martin

  3. #3
    Registered User
    Join Date
    04-21-2009
    Location
    Puyallup, WA
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: Search Sheet2 Column A For Value In Textbox On Sheet1 Then Offset Right By 1-5 Co

    Thank you mrice! I definitely agree your method of adding and subtracting 1 was much better haha. I had it copying and pasting values here and there one cell to another... I just didn't know how the visual basic to do this.

    I can't thank you enough. I modified the spreadsheet and it is now pretty awesome. I didn't want to add buttons to have to manually update the total column. I would rather have some kind of change event where when one of the five service column numbers change, it reduces or increases the total column row for that sku + or - 1. Since I don't know how to do that, I just added buttons.

    I really appreciate your help. PM me with your Paypal email. Attached is the final version of what I came up with if in case anyone ever stumbles across this post.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: Search Sheet2 Column A For Value In Textbox On Sheet1 Then Offset Right By 1-5 Co

    I've modified your workbook a little:
    Attached Files Attached Files
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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