Use VBA to duplicate rows based on a cell but making changes

January 5, 2015 at 16:21:49
Specs: Windows 7
hey, i'm a begginer and I have a row that contains data from a job we did. the last few columns are the workers involved, so I have a column Installer 1, Installer 2 and Installer 3. We can have 1, 2 or 3 of them depending on the job and will be like this:

TO-NB-NB Only 1 worker, Tomo. (NB=Nobody)
TO-ST-NB Two workers, Tomo and Steve
MK-ST-TO 3 guys, Mike Tomo and Steve

I've extracted the 3 names into individual cells, so now I need to create an entry (row) for each person. So if 2 or more installers, we need to copy that row once for 2 inst. or twice if 3 workers.

BUT, I'd also need to leave only one name of installer per row, so when I add the hours worked on row 1, as there were 2 guys out, I'll have 2 hours as result. But if I leave both names on both rows, the result will be 4...
Did I explain myself??

Thanks for your help in advance!


See More: Use VBA to duplicate rows based on a cell but making changes

Report •

January 6, 2015 at 17:27:42
It's not clear to me if you already have some VBA doing part of the task
already or if you are starting with nothing.

How have you "extracted the 3 names into individual cells"?

What if there are only 1 or 2 names? Are you extracting "NB"?

I think we need some more details.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Report •
Related Solutions

Ask Question