how do I create a macro to auto insert rows?
I have a 1000+ list and i want to enter a blank row after each entry that
does not equal the prior one. The repeated entries are not evenly spaced. Can a macro look at a value, determine if it's equal to the prior, and if not, insert a row? thanks. |
how do I create a macro to auto insert rows?
Try this:
Sub Macro1() For i = 1 To 40 j = i + 1 If Not (Cells(i, 1) = Cells(j, 1)) Then Rows(j).Select Selection.Insert i = i + 1 End If Next End Sub -- Gary''s Student "aashish" wrote: I have a 1000+ list and i want to enter a blank row after each entry that does not equal the prior one. The repeated entries are not evenly spaced. Can a macro look at a value, determine if it's equal to the prior, and if not, insert a row? thanks. |
All times are GMT +1. The time now is 11:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com