+ Reply to Thread
Results 1 to 7 of 7

Copy/Paste cell range from sheet 1 to sheet 2 in numbers match in reference columns.

  1. #1
    Registered User
    Join Date
    01-28-2014
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    22

    Copy/Paste cell range from sheet 1 to sheet 2 in numbers match in reference columns.

    I know Vlookup is has this function but I'm looking for something with a little more security and functionality when sheet 2 changes.

    Looking for help with (VBA) in a search, copy, past range code.

    Sheet 1 is the inventory sheet, Part number column (Q) Sell Price column (O) Quantity column (N)

    Sheet 2 quote sheet, Part number column (A) Sell Price Column (H) Quantity Column (G) Quotes are sent to me and I change format.

    If # column (Q) sheet 1 matches # column (A) sheet 2 () then copy the sell price and quantity from sheet 1 column (O)-(N) from the corresponding Row, then Paste that info into sheet 2 column (H)&(G) in the corresponding row.

    No wander I can't get this one down typing it our was tricking..lol

    The Quotes will change every month but the format will stay the same. I have used Vlookup but ran into trouble with it.
    I'm not that good with VBA yet, I do have a little Exp. with it. I wrote VBA () that can find the matching #'s and change cell color of the matches only. Then move the info up. but only with sheet 1 and sheet 2 pasted together and sorted into one another creating a single sheet.

    This is two confusing for the wife. She would like two sheets. And just move the info needed out of the inventory sheet to the quote sheet.
    If I could get some Help with this It would be very appreciated. Thank You in Advance.
    Attached Files Attached Files
    Last edited by trickedout; 03-14-2016 at 02:19 PM.

  2. #2
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Copy/Paste cell range from sheet 1 to sheet 2 in numbers match in reference columns.

    Hello TrickedOut,

    I don't think you need VBA.

    If you type this formula into Sheet2!G2
    =INDEX(Sheet1!N$2:N$10000,MATCH(Sheet2!$A2,Sheet1!$Q$2:$Q$10000,0))
    then copy it across so that in Sheet2!H2 you see:
    =INDEX(Sheet1!O$2:O$10000,MATCH(Sheet2!$A2,Sheet1!$Q$2:$Q$10000,0))
    then copy these cells down, you will get what I think you are after. That is, the QTY and Price from the matching Ref # on Sheet 1.

    Having said that, the data you are currently showing in column G and H is mostly different so I don't know if it's a bad example, or I haven't understood the requirement!

    Also, the first example I looked at (BBB# 3205) there is more than one row for 3205 which means bad data for what we are trying to achieve. This method will only find the first one.

    I don't understand the last half of your email at all, so have not addresses it.

    I hope this helps, please let me know!

    Regards,

    David


    - Please click on the *Add Reputation button at the bottom of helpful responses.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


  3. #3
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Copy/Paste cell range from sheet 1 to sheet 2 in numbers match in reference columns.

    Duplicate - posted in error

  4. #4
    Registered User
    Join Date
    01-28-2014
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Copy/Paste cell range from sheet 1 to sheet 2 in numbers match in reference columns.

    Sorry for my grammar.

    BBB # 3205 on the quote sheet, this is telling me they want to purchase the 3205, in row 11, 3205MIX in row 850, this is telling me they will buy that body style of the unite in a mix,witch can be multiple part #'s. Also the data in (G) & (H) was supposed to be empty on sheet 2. I messed up and attached a completed quote, I will fix and attach a new one.

    What I meant in the last half, sheet 1 is my inventory so that sheet data might change,Qty up & down more parts numbers added, price changes but the header format will always stay the same. Also in sheet 1 there can be more the one row with the same Lester # number in (Q) column. Lets say in row 5 was Part # 6659 Qty 10 @ $10.00 In row 50 part number 6659 Qty 30 @ $10.00 I would need Qty 40 moved over to sheet 2 and $10.00 put in the price cell in sheet 2. If a location for 6659 fills up in our inventory. Then we create a new Physical location for 6659 and new row will be created in the inventory workbook for 6659, now the inventory will have 2 row's with part # 6659.

    The reason I was looking for VBA is so I could create a module, link a button to it, so when I paste a new quote into sheet 2 every month all I have to do Is click the button in sheet 1. but if you don't think it's necessary then I'm just probably over thinking it. Any way Thank you very much for helping me out.

    I was wondering if we could add to the formula ( if there is a 0 or blank in the QTY cell (N) in sheet 1( (then display nothing in (G)&(H) in sheet 2. Thanks Again the formula works great the only thinks is I would have to manually remove all 0 and the price next to the zero's. If I could get it to display nothing if 0 or blank in the in the qty cell on the matching part # that would be great.
    Attached Files Attached Files
    Last edited by trickedout; 03-15-2016 at 09:51 AM.

  5. #5
    Registered User
    Join Date
    01-28-2014
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Copy/Paste cell range from sheet 1 to sheet 2 in numbers match in reference columns.

    Sorry, I had a death in the family and have been, well not myself lately. I Thank You for your reply and help. what does the Duplicate-Posted in error mean?

  6. #6
    Registered User
    Join Date
    01-28-2014
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Copy/Paste cell range from sheet 1 to sheet 2 in numbers match in reference columns.

    I got this going great !Just completed an advanced refresher course. Vlookup worked perfectly for this as did your formula.

  7. #7
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Copy/Paste cell range from sheet 1 to sheet 2 in numbers match in reference columns.

    I'm sorry to hear about your recent bereavement. I trust you will feel better soon.

    Quote Originally Posted by trickedout View Post
    what does the Duplicate-Posted in error mean?
    I accidentally posted my reply twice, so deleted the duplication.

    I hope this helps, please let me know!

    Regards,

    David


    - Please click on the *Add Reputation button at the bottom of helpful responses.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


+ 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. Replies: 3
    Last Post: 11-06-2014, 01:23 AM
  2. [SOLVED] Excel Macro to lookup sheet name with a range of cells and paste in the reference sheet
    By mishaq in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-08-2013, 02:55 PM
  3. Copy Cell Range From Previous Sheet and Paste to Active Sheet
    By jtal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2013, 03:26 PM
  4. Replies: 7
    Last Post: 12-03-2012, 03:10 AM
  5. Replies: 3
    Last Post: 11-20-2012, 02:25 PM
  6. Replies: 0
    Last Post: 10-25-2012, 03:38 PM
  7. [SOLVED] copy and paste links from another sheet dependant on cell reference
    By nicko54 in forum Excel General
    Replies: 3
    Last Post: 06-28-2012, 02:57 AM

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