Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 09-07-2011, 02:33 AM
Catalin.B Catalin.B is offline Sorting or an Excel formula to insert a blank row after ending a series. Windows Vista Sorting or an Excel formula to insert a blank row after ending a series. Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

Try this code:
Code:
Sub Macro2()
Dim i As Integer
With ActiveSheet

For i = 2 To 25
Range("E" & i).Value = Range("B" & i).Value

    Next i
    End With
    
    With ActiveSheet
    For i = 2 To 25
    If Range("E" & i + 1).Value > Range("E" & i).Value Then
Range("E" & i + 1).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove

    End If
    i = i + 1
    Next i
    End With
End Sub
If you have a long range, you may disable screen updating to speed up macro...
Attached Files
File Type: xlsm test spaces in col.xlsm (15.2 KB, 16 views)
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to capture start and ending Ref. Nos. in an array KIM SOLIS Excel 5 09-07-2011 07:43 AM
Sorting or an Excel formula to insert a blank row after ending a series. How to organize and insert blank cells between a huge number of data? tareq Excel 12 09-29-2010 02:12 PM
Sorting or an Excel formula to insert a blank row after ending a series. Add text to the beginning/ending of each line in word ballmoney Word 1 01-17-2010 02:19 AM
Sorting columns in Excel - please advise Jonre Excel 2 08-21-2009 02:38 AM
Sorting or an Excel formula to insert a blank row after ending a series. How to turn all blank lines into non-blank for legal forms sieler Word 3 04-12-2009 01:38 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft