+ Reply to Thread
Results 1 to 9 of 9

Insert line where value in colume M exceeds value in column AC and some

  1. #1
    Registered User
    Join Date
    10-06-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    3

    Insert line where value in colume M exceeds value in column AC and some

    Hello Excel Forum,

    I have a spreadsheet with multiple columns. Column M states the number of boxes required to be despatched per that product. Column AC states the maximum boxes that can be stacked on a pallet. I am unsuccessfully trying to create code that do the following;

    If value in column M exceeds value in column AC amend the value in column M to the value in column AC and then create a duplicate line below for the remaining boxes.

    Repeat process until column M value less than or equal to column AC value. Loop through all part codes.

    As an example...

    Original file...
    Line No. Column B Column M Column AC
    Part Boxes Ordered Max Pallet Qty

    1 ABC123 22 8


    File post VBA...
    Line No. Column B Column M Column AC
    Part Boxes Ordered Max Pallet Qty

    1 ABC123 8 8
    2 ABC123 8 8
    3 ABC123 6 8


    Hopefully my ramblings above make sense, any help would be massively appreciated!

    Carl

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Insert line where value in colume M exceeds value in column AC and some

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    10-06-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    3

    Re: Insert line where value in colume M exceeds value in column AC and some

    Hi Olly,

    I have tried to upload a file 82.5KB and get the following error message;

    407 [IOErrorEvent type = "ioError" bubbles=false cancelable=false eventPhase=2 text="Error#2038"]

    Any ideas?

    Thank you

    Carl

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Insert line where value in colume M exceeds value in column AC and some

    If you're using Internet Explorer, try turning on Compatibility View.
    If that doesn't work, an alternate browser maybe?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Insert line where value in colume M exceeds value in column AC and some

    Does this help?

    Please Login or Register  to view this content.

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Insert line where value in colume M exceeds value in column AC and some

    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  7. #7
    Registered User
    Join Date
    10-06-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    3

    Re: Insert line where value in colume M exceeds value in column AC and some

    John H. Davis, MickG you guys are heroes! Thank you so much, i'm in awe!

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Insert line where value in colume M exceeds value in column AC and some

    You're welcome. Glad to help out and thanks for the feedback.

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Insert line where value in colume M exceeds value in column AC and some

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] code exceeds max. # of characters per line
    By adamheon in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-19-2014, 11:35 AM
  2. Replies: 1
    Last Post: 08-30-2013, 04:56 PM
  3. Replies: 3
    Last Post: 01-29-2012, 11:29 AM
  4. Replies: 3
    Last Post: 03-21-2009, 09:37 PM
  5. How can I look up max of one colume and display the colume to the.
    By Brian Cornejo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-21-2005, 02:06 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