Solved

Excel - how to remove all items with more then 7 characters from a column

Posted on 2014-04-24
2
309 Views
Last Modified: 2014-04-24
Hi EE

I have a column with 1000 rows and I need to remove all the rows where the item is more then seven characters .. any ideas ?

example:
a123456
b1234567 << Remove
b123456
c12345678  << Remove
0
Comment
Question by:MilesLogan
2 Comments
 
LVL 26

Accepted Solution

by:
pony10us earned 500 total points
ID: 40020981
Sub DelRows()
Dim LR As Long, i As Long
Application.ScreenUpdating = False
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = LR To 1 Step -1
    If Len(Range("A" & i).Value) > 7 Then Rows(i).Delete
Next i
Application.ScreenUpdating = True
End Sub

Open in new window

0
 
LVL 2

Author Closing Comment

by:MilesLogan
ID: 40021061
pony10us ! thank you
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Move data from one sheet to another 11 36
Recycle MSExchnge powershell app Pool 2 17
Exchange 2013 - Script needed 7 36
Powershell Script Help 3 24
A procedure for exporting installed hotfix details of remote computers using powershell
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question