Solved

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

Posted on 2014-04-24
2
311 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

735 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