ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inserting a blank row when data changes (https://www.excelbanter.com/excel-programming/338672-inserting-blank-row-when-data-changes.html)

achidsey

Inserting a blank row when data changes
 
Excel Experts:

I have a spreadsheet similar to the following

A B
1 4K3F
2 4K3F
3 4K3F
4 5B6L
5 5B6L
6 8E2B
7 8E2B

I would like my macro to go down column A, and each time the data changes
(i.e., row 4 and row 6) insert a blank row.

What code would do this?

Thanks
Alan

--
achidsey

Don Guillett[_4_]

Inserting a blank row when data changes
 
try something like this working from the bottom up

sub insertatchange
for i=cells(rows.count,"a").end(xlup).row to 1 step -1
if cells(i-1,"a")<cells(i,"a") then rows(i).insert
next i
end sub
--
Don Guillett
SalesAid Software

"achidsey" (notmorespam) wrote in message
...
Excel Experts:

I have a spreadsheet similar to the following

A B
1 4K3F
2 4K3F
3 4K3F
4 5B6L
5 5B6L
6 8E2B
7 8E2B

I would like my macro to go down column A, and each time the data changes
(i.e., row 4 and row 6) insert a blank row.

What code would do this?

Thanks
Alan

--
achidsey





All times are GMT +1. The time now is 02:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com