+ Reply to Thread
Results 1 to 7 of 7

Transfer Part Qty from one sheet to another.

  1. #1
    Registered User
    Join Date
    02-08-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    80

    Transfer Part Qty from one sheet to another.

    Hi

    I need help with macro please can i ask for assistant. Have been trying now for few days and not getting any where.

    I have attached file.

    User enters Slot No in N13 (AM351001).
    Cell N17 (code) & O17 (qty) is Vlookup AM351001 from sheet called Consumables In AM Rack.

    What i want to do is user enter a slot in N13, Vlookup looks up the code & qty, then user enters qty which needs to be subtract in cell P17, O19=date and O20=name..

    Once the data is filled in (green boxes), I want P17 qty to be subtract from the sheet called Consumables In AM Rack. And transfer the details which user has enter in sheet called Consumables Used From AM Rack.

    example.
    User enters in green box.
    cell N13 = AM351001
    cell P17 = 300
    cell O19 = 18/08/2009
    cell O20 = Hit.

    When button is pressed.

    1st cell P17 = 300 is subtracted from Consumables In AM Rack against AM351001.

    2nd copy all the details which user enterd in sheet Consumables Used From AM Rack.
    cell N17 = (lookupcode) in column B
    cell P17 = 300 in column C
    cell O19 = 18/08/2009 in column A
    cell O20 = Hit. in column D

    If you look at the file you will easly see it.

    Please please can someone assist me.

    Many thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Transfer Part Qty from one sheet to another.

    Hi,

    First name your 4 cells

    N17 = "Code"
    Q17 = "Qty"
    P19 = "Date"
    P20 = "Authorised"

    Now add the following procedure and attach it to your button

    Please Login or Register  to view this content.
    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-08-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: Transfer Part Qty from one sheet to another.

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    First name your 4 cells

    N17 = "Code"
    Q17 = "Qty"
    P19 = "Date"
    P20 = "Authorised"

    Now add the following procedure and attach it to your button

    Please Login or Register  to view this content.
    HTH
    Richard,

    Mant Thanks work great, only one small question.

    How do i clear the following cells once the macro has finished doing its job.

    N13 = "Slot"
    Q17 = "Qty"
    P19 = "Date"
    P20 = "Authorised"

    Many thks once again.

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Transfer Part Qty from one sheet to another.

    Changes Made

    Sheet3
    Unmerged all data cells (avoid merged cells like the plague - use cetner across selection instead)

    Moved look up formulas for Code and Qty to adjacent cells to perform look up once (for efficiency)

    Revised lookup formula in cells for Code and Qty to reference the look up cells per above change.

    VBA Code written for the command button

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

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Transfer Part Qty from one sheet to another.

    Hi,

    Just use the instructions

    Please Login or Register  to view this content.
    Rgds

  6. #6
    Registered User
    Join Date
    02-08-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: Transfer Part Qty from one sheet to another.

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Just use the instructions

    Please Login or Register  to view this content.
    Rgds
    Hi Richard,

    I copied your code which you adviced so it look like below.

    Please Login or Register  to view this content.

    I got

    Run-time error '1004':
    Cannot change part of a merged cell.

    How do i get round this except for demerging. As it will spoil the layout look of the sheet.

    This there any other way round.

    Many thks for assistant.

  7. #7
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Transfer Part Qty from one sheet to another.

    Run-time error '1004':
    Cannot change part of a merged cell.

    How do i get round this except for demerging. As it will spoil the layout look of the sheet.
    Apparently you haven't bothered to look at the solution I provided as it does away with merged cells AND retains the look.

    This there any other way round
    Yes. Don't use merged cells because they hinder more than they help. Use center across selection instead and adjust row heights rather than use blank rows - all of whch the solution I gave you uses.

+ 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