Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
aashish
 
Posts: n/a
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert rows based on specific value bob Excel Worksheet Functions 6 February 29th 08 07:11 PM
Vb macro stops when I try to create more than 89 charts Tiberius Charts and Charting in Excel 0 January 19th 06 05:52 PM
Macro Help In Excel welshlad Excel Discussion (Misc queries) 14 October 26th 05 02:34 PM
Insert rows Mr. G. Excel Worksheet Functions 3 March 31st 05 03:49 AM
How do I insert the date using a macro tara0801 Excel Discussion (Misc queries) 4 February 10th 05 09:09 PM


All times are GMT +1. The time now is 01:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"