Macro to add multiple identical rows of data from a workbook before or after each change in Column A

rickadams

New Member
Joined
Feb 11, 2018
Messages
32
I can insert blank rows between the data when value changes. I am asking how to add the same 7 rows of common data (as in a checklist) to the top or bottom of every sheet and also add the data from the A column after the change to the 7 rows. I can add them to the top of the list with the rows to repeat at the top $1:$7 however this method does not include the data from Column A. I would prefer to add the 7 rows to the top or bottom and add the data from the current A Column before the data changes. Thank you for your help.

BEFORE
LOCATIONTASK OR ITEM REPAIRS REQUIREDCATEGORYNOTES - MATERIAL STATUSASSIGNED TOSTATUS OR TASK IS IT COMPLETE?
REPLACE THE SMOKE DETECTOR BATTERIES IF THEY ARE REPLACEABLEBATTERYN/A TO 10 YEAR SYSTEMSRICK
REPLACE THE DOOR LOCK BATTERIESBATTERYRICK
TIGHTEN ALL CABINET DOOR HINGESGENERALTOM
CHANGE THERMOSTAT BATTERIESBATTERYN/A TO 10 YEAR SYSTEMSBILL
CHANGE AIR FILTERS AS REQUIREDFILTERSJOE
PLEASE BE SURE A/C IS OFF WHEN LEAVING AT THE END OF THE DAYEVERYONECHECK DAILY IF NOT OCCUPIEDEVERYONE
121 MAIN STREETBED 5 - PAINT ALLPAINTJOECOMPLETE
121 MAIN STREETLR- PAINT 3 WALLSPAINTJOECOMPLETE
121 MAIN STREETBED 4 REPAIR LOCKLOCKPLUNGER WAS BAD, REPLACED 06/04/24JOHNCOMPLETE

The data in Column A (location) could be listed 1 time or 50 times until the next address and the blank on the 7 lines at $1:$7 are always the same to be added to the list.
A could have:

Sheet would look like this when VBA is finished
LOCATIONTASK OR ITEM REPAIRS REQUIREDCATEGORYNOTES - MATERIAL STATUSASSIGNED TOSTATUS OR TASK ITEM COMPLETE
121 MAIN STREETREPLACE THE SMOKE DETECTOR BATTERIES IF THEY ARE REPLACEABLEBATTERYN/A TO 10 YEAR SYSTEMSRICK
121 MAIN STREETREPLACE THE DOOR LOCK BATTERIESBATTERYRICK
121 MAIN STREETTIGHTEN ALL CABINET DOOR HINGESGENERALTOM
121 MAIN STREETCHANGE THERMOSTAT BATTERIESBATTERYN/A TO 10 YEAR SYSTEMSBILL
121 MAIN STREETCHANGE AIR FILTERS AS REQUIREDFILTERSJOE
121 MAIN STREETPLEASE BE SURE A/C IS OFF WHEN LEAVING AT THE END OF THE DAYEVERYONECHECK DAILY IF NOT OCCUPIEDEVERYONE
121 MAIN STREETBED 5 - PAINT ALLPAINTJOEHOLD OFF LAST
121 MAIN STREETLR- PAINT 3 WALLSPAINTJOEHOLD OFF LAST
121 MAIN STREETBED 4 REPAIR LOCKLOCKPLUNGER WAS BAD, REPLACED 06/04/23JOHNCOMPLETE


Thank you for your help
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,221,831
Messages
6,162,248
Members
451,756
Latest member
tommyw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top