Asp.net,PL SQL Tips for error resolution,Research,Development,SQL 2014,2012,2008,Procedural language,SP,excel macro ,Musical notations.

January 14, 2013

How to insert blank row on column change in excel

This is a Macro code in excel to insert blank row on column change in excel.

 Dim rval As String, i As Long  
 rval = Cells(1, 1): i = 2  
 Do Until Trim(Cells(i, 1) & "") = ""  
 If Cells(i, 1) <> rval Then  
 rval = Cells(i, 1)  
 Rows(i).insert shift:=xlDown  
 i = i + 1  
 End If  
 i = i + 1  
 Loop  
 End Sub