Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-07-2011, 01:27 AM
PRADEEPB270's Avatar
PRADEEPB270 PRADEEPB270 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
Novice
Sorting or an Excel formula to insert a blank row after ending a series.
 
Join Date: Aug 2011
Location: Gurgaon-INDIA
Posts: 17
PRADEEPB270 is on a distinguished road
Default Sorting or an Excel formula to insert a blank row after ending a series.


I have a file consisting so many part codes in a column.Most of the part codes are same.Now,I want when a particular part code end,a blank row should be insert and a new part code begin and so on.Is it possible through excel?

Pl.refer attach file for more clarification.
Attached Files
File Type: xlsx Book1.xlsx (8.4 KB, 4 views)
Reply With Quote
  #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, 8 views)
Reply With Quote
Reply

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 07:28 PM.


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