2 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

How Do I Copy a Row to Another Sheet in Workbook Based on a Value in Column?

Our take

Struggling to copy rows from your master sheet to specific item code tabs based on conditions can be frustrating, especially when you're trying to maintain historical data. Fortunately, there's a way to automate this process using formulas or scripts that copy relevant information without overwriting existing entries. In this guide, we’ll explore methods to efficiently transfer data from your source sheet to target sheets based on column values, ensuring that you avoid duplicates and preserve your records even when the source sheet resets.

I've looked at the Google machine and have not found an answer to my situation.

Situation: I have a master sheet (source sheet) that is used for tracking ordering information (date of order, date shipped, sequential order number, number of items, and the item code). This sheet is cleared every year and the order numbers restart at 1. The other sheets in the workbook are the tabs for each item code (target sheets) where I track the ordering information for that item. Those tabs are used to track over multiple years.

Goal: Copy data in source sheet row from columns C,D,E,F,H,I,J,K to the item code sheet (target sheet) if column G contains the item code. I would like it to search all of the source sheet so that if a line in the source sheet gets added above the last line, it pulls it into the target sheet, but I would like to avoid it pasting duplicate lines if possible. I would also like it to not erase what was copied to the target sheet once the source sheet is restarted at the beginning of the year. Does anyone know if this is possible?

I tried using =filter, but that erased the data when the source sheet was erased and it would be a lot of work to copy and paste as text everything in each target sheet before restarting the source sheet. I then tried a VBA script for each target sheet, but it only copied the last line of the relevant source, which was not helpful when there is prior info already logged. Example of what my workbook is like

https://preview.redd.it/1znxbxpqy1kg1.png?width=1365&format=png&auto=webp&s=709b4b736f1883ca293e203829a74a6b64ec206e

submitted by /u/Dismal_Kangaroo_47
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article

Related Articles