+ Reply to Thread
Results 1 to 2 of 2

Alignment of Order Data, Confirmation, and New Confirmations

  1. #1
    Registered User
    Join Date
    09-28-2022
    Location
    Sheboygan, Wisconsin
    MS-Off Ver
    16
    Posts
    2

    Unhappy Alignment of Order Data, Confirmation, and New Confirmations

    Situation: An initial order is placed with a vendor. Quantity, Standard Delivery Date. and Order Date are recorded for each line item (Initial Order Tab). The vendor takes the order and they say, "nope, you can't have it then, but here is what you can have." And respond with their First Confirmations. They will give a quantity and date for when they are agreeing to deliver the items (First Confirmation tab). With global supply issues our vendors are sometimes unable to meet their original commitments. Sales chases down the missing items and gets New Confirmations from the vendor (New Confirmation tab).

    Problem: I need to link the new confirmations to first confirmations to initial orders to get so I can evaluate how our supply chain is performing based on systemic dates as compared to vendors first confirmed dates, etc. I have included an example of one order and the information associated with that order. The solution is going to be used to analyze ~150 orders at a time (so lots of lines).

    Initial thoughts: My plan was to concatenate the Purchase Document, Line Item, and Schedule as a number. Then duplicate the rows with VBA. The concatenated number could then also be used as a serial count and/or use a series of pivot tables to get all of the lines/dates traced backwards.

    Formula for concatenation (=IF($A2="","",(A2&"00000")+0+((B2&"00")+0)+(F2+0))

    VBA for Row Duplication
    'Duplicate rows based on column quantity
    Sub DupeRows()
    'Declare Variables
    Dim cell As Range
    'Set initial cell - condition to duplicate
    Set cell = Range("e2")
    'Formula - Do While Not - If/Then - Loop
    Do While Not IsEmpty(cell)
    Set cell = cell.Offset(cell.Value, 0)
    If cell > 1 Then
    Range(cell.Offset(1, 0), cell.Offset(cell.Value - 1, 0)).EntireRow.Insert
    Range(cell, cell.Offset(cell.Value - 1, 1)).EntireRow.FillDown
    End If
    Set cell = cell.Offset(cell.Value, 0)
    Loop
    End Sub

    Conclusion: This is a brute force approach and I know that their must be a more elegant solution. Please help
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    09-28-2022
    Location
    Sheboygan, Wisconsin
    MS-Off Ver
    16
    Posts
    2

    Re: Alignment of Order Data, Confirmation, and New Confirmations

    Had an extra line in the VBA code that I had included, basically looping back to the beginning before running so it did nothing. Anyway, the corrected VBA macro is below...

    VBA for Row Duplication
    'Duplicate rows based on column quantity
    Sub DupeRows()
    'Declare Variables
    Dim cell As Range
    'Set initial cell - condition to duplicate
    Set cell = Range("e2")
    'Formula - Do While Not - If/Then - Loop
    Do While Not IsEmpty(cell)
    If cell > 1 Then
    Range(cell.Offset(1, 0), cell.Offset(cell.Value - 1, 0)).EntireRow.Insert
    Range(cell, cell.Offset(cell.Value - 1, 1)).EntireRow.FillDown
    End If
    Set cell = cell.Offset(cell.Value, 0)
    Loop
    End Sub

+ 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: 21
    Last Post: 12-21-2018, 11:29 AM
  2. [SOLVED] Display Confirmation Message When Specific Data Not Found
    By swordswinger710 in forum Excel Programming / VBA / Macros
    Replies: 63
    Last Post: 09-06-2016, 11:40 AM
  3. [SOLVED] VB code to populate (count) data from vertical alignment to a sheet with existing data
    By cmokasak in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-24-2016, 04:54 AM
  4. Show confirmation box before sending data to worksheet...
    By z-eighty2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-13-2013, 03:41 PM
  5. [SOLVED] Confirmation Box when sending order or not allowed box depending on cell value
    By BullseyeThor in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-08-2012, 11:23 AM
  6. Confirmation Box when sending order or not allowed box depending on cell value
    By BullseyeThor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2012, 04:13 AM
  7. [SOLVED] data alignment
    By maheshr68 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-02-2012, 10:39 AM

Tags for this Thread

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