A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

separate lines in excel



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old May 12th, 2010, 12:57 PM posted to microsoft.public.excel.misc
Kevin
external usenet poster
 
Posts: 910
Default separate lines in excel

I posted this in this group on saturday.

The first half is my question.

The 2nd half is the response.

My question today...

What do I do with it. I think it goes into the visual basic editor but I
have been wrong before. Thats why I am here.

If that is the case how do I run it. If not the case what do I do with it.

Can I copy and paste it?

Thanks

Question
Here is a problem I have:
123456789
134567890
135678901
1456789012
157890123
this group of numbers is in my Sheet and each line is in a row by itself and
they are in 9 different columns. for brevity I just used 9 numbers for each
line. I need to know if there is a way to auto insert a row between each
individual number. My real SS will have about 900 rows with 60 characters
per row that I have already performed text to columns on. There Can be as
few as 1 row per number or as many as 25 rows per number. in the sample
above the second number would be the dividing line Please help


Sub InsertRow_At_Change()
'Sandy Mann July 1st, 2007
Dim LastRow As Long
Dim X As Long
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False

For X = LastRow To 3 Step -1
If Cells(X, 1).Value Cells(X - 1, 1).Value Then
If Cells(X, 1).Value "" Then
If Cells(X - 1, 1).Value "" Then
Cells(X, 1).entirerow.Insert Shift:=xlDown
End If
End If
End If
Next X
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:52 AM.


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