Solved

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

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

752 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