+ Reply to Thread
Results 1 to 3 of 3

Macro to copy row based on cell value, then replace with other number

  1. #1
    Registered User
    Join Date
    01-25-2016
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    2

    Macro to copy row based on cell value, then replace with other number

    Hi All,

    I have a (for me) complicated request.

    For an inventory I would like to have rows/data palletised (1 row per pallet). However, i receive the data with multiple pallets in one line, and totals of units.

    What i would like, is a macro to copy the entire row (article # etc) a number of times as the total amount of pallets. Below an example with 1 and 3 pallets. The 1 pallet has the correct pieces per pallet, but for the 3 pallets, it will be split according to the info available. I would like a popup message box to ask for manual input, but after it has been asked for the total pallets, the sum of the entire input should match the original field.

    Below the table.

    Pallets Article# Pieces Other info
    1 AAB 50 ABCD
    3 ABB 500 DCBA

    This should become the following table, in which for every line of the 3 pallets it copies, excel asks how many units are in the pallet.
    Pallets Article# Pieces Other info
    1 AAB 50 ABCD
    1 ABB 100 DCBA
    1 ABB 100 DCBA
    1 ABB 300 DCBA

    Then after it is done with the 3 pallets, it will match the sum of the input with the original. Say the total was 500, and someone entered 100, 100 and 301, it should start over and/or mention it's incorrect.

    Does anyone have any idea how to do this? :S

  2. #2
    Registered User
    Join Date
    01-25-2016
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    2

    Re: Macro to copy row based on cell value, then replace with other number

    Does any have an (even partial) solution to this?
    Last edited by alansidman; 02-04-2016 at 05:36 PM.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,658

    Re: Macro to copy row based on cell value, then replace with other number

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. Macro to replace any 10 digit number in the cell which has other description
    By harisha19 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2014, 05:17 AM
  2. Replies: 1
    Last Post: 08-18-2013, 05:00 PM
  3. [SOLVED] Find and Replace Macro Based on Cell Reference and Inputbox
    By bwaite87 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-07-2013, 10:46 AM
  4. Macro to copy and replace based on dates
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-18-2012, 09:28 AM
  5. [SOLVED] Macro to copy cell contents then used Find & Replace to put text elswhere.
    By AimeeNZ in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-12-2012, 01:06 AM
  6. [SOLVED] Excel VBA/Macro - Copy Number of Rows based on the number in a cell to another sheet
    By diane.alexander58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2012, 11:32 AM
  7. [SOLVED] Need help writing macro to replace one cell based on contents of adjacent cell
    By TheRaptMuse in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2012, 12:54 PM
  8. Replies: 2
    Last Post: 06-27-2012, 11:31 PM

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