Solved

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

Posted on 2014-04-24
2
307 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The article will show you how you can maintain a simple logfile of all Startup and Shutdown events on Windows servers and desktops with PowerShell. The script can be easily adapted into doing more like gracefully silencing/updating your monitoring s…
A procedure for exporting installed hotfix details of remote computers using powershell
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now