View Single Post
 
Old 07-08-2018, 02:27 PM
Marcia's Avatar
Marcia Marcia is offline Windows 7 32bit Office 2007
Expert
 
Join Date: May 2018
Location: Philippines
Posts: 551
Marcia has a spectacular aura aboutMarcia has a spectacular aura aboutMarcia has a spectacular aura about
Default VBA to Insert variable rows based on a data in active cell

I have a table of current and delinquent taxpayers. What's the macro to automate the insertion of 10 entire rows above the cell where I typed 1979 (Column L). From cell 1979, the 10 inserted rows should contain 1986, above 1986 is 1993, above 1993 is 2005, above 2005 is 2011, then 2012, 2013, 2014, 2015, 2016, 2017. While Column K have values of 1980 to 2017.
It should look this way after running the macro.
Col K Col L
2017 2017
2016 2016
2015 2015
2014 2014
2013 2013
2012 2012
2006 2011
1994 2005
1987 1993
1980 1986
1979
There should be a loop that when I type in the same column L but different row 1986, 9 rows are inserted above and the blank cells above 1986 contain 1993 to 2017, column K shows 1987 to 2017. If I type 1993, 8 rows are likewise inserted and 2005 to 2017 automatically appear on the blank cells and so on until 2015.

Last edited by Marcia; 07-08-2018 at 02:40 PM. Reason: additional information
Reply With Quote