+ Reply to Thread
Results 1 to 4 of 4

a macro question

  1. #1
    Registered User
    Join Date
    11-30-2006
    Posts
    57

    Question a macro question

    i am having a problem creating a macro, here's the problem:

    i have item numbers ( such as 1000,1001,1002...) and i have a quantity for them which i am wanting to change.

    the problem is i dont know how to make the macro search for that specific item number and then update the quantity.

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Jymoz
    i am having a problem creating a macro, here's the problem:

    i have item numbers ( such as 1000,1001,1002...) and i have a quantity for them which i am wanting to change.

    the problem is i dont know how to make the macro search for that specific item number and then update the quantity.
    Hi,

    to get a user to input a number, (as opposed to a user filling A1 - A100 cells etc

    myNum = Application.InputBox("Enter a number")

    and use mynum for your find, and update from there.

    hth
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Registered User
    Join Date
    11-30-2006
    Posts
    57
    yeah thanks that should work although i'm still at a loss to how i can use that to search for the item number

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by Jymoz
    yeah thanks that should work although i'm still at a loss to how i can use that to search for the item number
    Hi,

    In a formula that would be =Match(A1:B5:B500,0) to get a row number, the rest is easy after that.

    In VB you could either drop a formula into A2 as

    Range("A2").Formula = "=Match(A1:B5:B500,0)"

    or try out the Application.WorksheetFunction.

    for the Match, but I have no workimg model of that to show.

    hth
    ---

+ 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