Results 1 to 14 of 14

Thread: Locate a set value and copy the value in the cell that's below it

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    VBAX Regular
    Joined
    Sep 2020
    Posts
    62
    Location
    Quote Originally Posted by p45cal View Post
    In the attached is a button near cell A2 of the Final sheet which runs the macro blah which does the same thing as before (refreshes the query table at L5 of the Final sheet) plus makes copies of the columns to your columns A and C.
    Be aware that I don't delete any previous data in your table, only overwrite, so if the lengths of the tables are different or they're in a different order you'll get mis-aligned data, so it's best to delete the whole table (yours) first.
    The query table is at L5 of the Final sheet, but it can be anywhere in the document (perhaps give it its own hidden sheet?).
    For comparison, there's a copy of the output of Bob Phillip's macro CopyDealerAccountNumber. They seem to be exactly the same.

    Your account numbers in column C are all numeric (no alpha characters at all); will they always be so? If not, my query might need a tweak.
    So what might cause it to debug right here?

    .QueryTable.Refresh BackgroundQuery:=False

    With the message:

    "Run-time '1004':
    [Expression.Error] 5 arguments were passed to a function which expects between 2 and 4."

    There's some sort of disconnect with my excel trying to "Refresh" the table. Should I be doing something to the file before running the BLAH macro? I noticed in Name Manager the ResultTable seems locked or greyed out...I don't have access to edit it. Even if I do a simple right click on the ResultTable and select Refresh, that same Expression.Error message comes up for me.

    Also, the length of the file with the Account numbers I'm guessing will vary from time to time....it won't always be the same.

    Thanks for your patience on walking me through this.
    Last edited by twmills; 10-07-2020 at 05:29 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •