|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Insert rows when column A data changes then shade and autosum blanks in columns E to I
I currently have a macro which inserts a row whenever the data in column A changes. What I want to add is that it also shades and autosums columns E throught to I as well.
Could somebody please help me with this? Here is the code that I am using to insert a row when the data in column A changes Sub InsRowsWhenCellDataChangesColA() Dim r As Long, mcol As String, i As Long ' find last used cell in Column A r = Cells(Rows.Count, "A").End(xlUp).Row ' get value of last used cell in column A mcol = Cells(r, 1).Value ' insert rows by looping from bottom For i = r To 2 Step -1 If Cells(i, 1).Value <> mcol Then mcol = Cells(i, 1).Value Rows(i + 1).Insert End If Next i End Sub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Parse data in one column to 3 other columns | texascpa | Excel | 4 | 02-20-2017 04:53 AM |
Counting Blanks in 1 Column and Non-Blanks in Another | dogwood705 | Excel | 4 | 02-07-2015 08:45 AM |
Insert values from multiple rows based on value in one column | pachmarhi | Excel | 3 | 07-18-2014 09:57 PM |
Macro for Column to Rows Data | brunssl2 | Excel Programming | 3 | 04-28-2014 07:07 AM |
Copying data from sheet with deleted columns creates blanks | ZGreyArea | Excel | 1 | 11-20-2013 10:12 AM |