Mar 05 2024 09:26 AM - edited Mar 06 2024 05:58 AM
I want to create a macro that copies items from a master PO sheet (3_Master PO Request)) to a standardized PO form (4A_PO Template) but I want this to occur by vendor. Additionally, I would like if items transferred to the standardized PO template would be removed from the list and then added to another sheet that has a running total for the year (4B_2024_CB3 PO Totals). How could I do this? I am mostly concerned with transferring from 3_Master PO Request to the 4A_PO Template. I've included a sample file. Thanks in advance 🙂
Mar 05 2024 04:44 PM - edited Mar 06 2024 06:01 AM
@qplsn9 I couldn't help but notice this is your third post now on this matter...
I think the main reason you're not getting any help is because the overall structure of the workbook, including the setup of the worksheet data and the existing VBA code, is poor. The column headers are inconsistent from one sheet to the next, there's no "Unit Price" found in the "3_Master PO Request" sheet, and it's unclear what "Qty" should be ordered for each item (how many over the Order Point do you want to order). Plus, the macros assigned to the "Export" and "Paste Values" buttons don't exist in this file... they are linked to another workbook: 'C:\Users\username\Desktop\...\filename.xlsm'. Looping through the data by vendor, 21 records at a time, is possible, but the current setup is so disjointed and there are too many unknowns for anyone to be able to help.
Even the code I helped you with previously (CopyRecordsByDisplayFormat), which was done blindly before I saw the actual file, I would do differently now. Advanced Filter would be a far more efficient (and simpler) method to use but would require the column headers to match from one worksheet to the next. The "Format" macro you have assigned to the "Filter" button changes the column headers to something other than their original values, which is odd because they don't even match the headers used in the final "4A_PO TEMPLATE" worksheet.
Paul Kelly has a number of videos on his YouTube channel, Excel Macro Mastery, that might help point you in the right direction:
Kind regards.
Mar 06 2024 05:45 AM
Mar 06 2024 05:57 AM