This macro:

1. Duplicates every row that has a value in G and adds them to the bottom of sheet at first empty row.
2. On those duplicated rows, it swaps the values in Column G with the values in Column F.

It works beautifully when there is data to consider:

Please Login or Register  to view this content.
Where it fails is when there is no data to consider.

My header starts on Row 4 and the columns go out to Column AQ.

On some of the sheets this will be run on as part of a larger macro, it is legitimate for those sheets to sometimes have no data, just the header.

When there is no data, this macro repeats the header three times, which messes up COUNT and SUMPRODUCT calculations on my summary sheet.

Any advice on how to get it to ignore those sheets that have no data? Like I said, it works perfectly provided there is data under the header - I just can't guarantee every sheet will have data!

Thank you!