![]() |
|
![]() |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
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 |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
texascpa | Excel | 4 | 02-20-2017 04:53 AM |
![]() |
dogwood705 | Excel | 4 | 02-07-2015 08:45 AM |
![]() |
pachmarhi | Excel | 3 | 07-18-2014 09:57 PM |
![]() |
brunssl2 | Excel Programming | 3 | 04-28-2014 07:07 AM |
![]() |
ZGreyArea | Excel | 1 | 11-20-2013 10:12 AM |