Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default find/delete row when cell has less than 16 alphanumeric characters

Hello,

How can I find a cell in column "E" that has less than 16 characters and then
delete that row?

Also, is there also a way to find duplicate cells in a column and delete
those rows containing those duplicate cells? Ex: three rows of data are
duplicates so i want to delete 2 of those rows.

Thanks in advance!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default find/delete row when cell has less than 16 alphanumeric characters

To delete rows with less than 16 characters use the below macro. For removing
duplicates Select range and from Advanced Filter option check unique records
only. You can copy that to another sheet.

For running the macro Set the Security level to low/medium in
(Tools|Macro|Security). 'Launch VBE using short-key Alt+F11. Insert a module
and paste the below code. Save. Get back to Workbook. Tools|Macro|Run
MyMacro()

Sub MyMacro()

lngRow = ActiveSheet.Cells(Rows.Count, "E").End(xlUp).Row
For lngTemp = lngRow To 1 Step -1
If Len(Trim(Range("E" & lngTemp))) < 16 Then
Rows(lngTemp).Delete
End If
Next

End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"Peruanos72" wrote:

Hello,

How can I find a cell in column "E" that has less than 16 characters and then
delete that row?

Also, is there also a way to find duplicate cells in a column and delete
those rows containing those duplicate cells? Ex: three rows of data are
duplicates so i want to delete 2 of those rows.

Thanks in advance!!!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default find/delete row when cell has less than 16 alphanumeric charac

Thanks Jacob.

"Jacob Skaria" wrote:

To delete rows with less than 16 characters use the below macro. For removing
duplicates Select range and from Advanced Filter option check unique records
only. You can copy that to another sheet.

For running the macro Set the Security level to low/medium in
(Tools|Macro|Security). 'Launch VBE using short-key Alt+F11. Insert a module
and paste the below code. Save. Get back to Workbook. Tools|Macro|Run
MyMacro()

Sub MyMacro()

lngRow = ActiveSheet.Cells(Rows.Count, "E").End(xlUp).Row
For lngTemp = lngRow To 1 Step -1
If Len(Trim(Range("E" & lngTemp))) < 16 Then
Rows(lngTemp).Delete
End If
Next

End Sub
--
If this post helps click Yes
---------------
Jacob Skaria


"Peruanos72" wrote:

Hello,

How can I find a cell in column "E" that has less than 16 characters and then
delete that row?

Also, is there also a way to find duplicate cells in a column and delete
those rows containing those duplicate cells? Ex: three rows of data are
duplicates so i want to delete 2 of those rows.

Thanks in advance!!!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
File names appended with ~ plus alphanumeric characters Augied Excel Discussion (Misc queries) 0 January 13th 09 04:23 AM
Deleting non-alphanumeric characters Mark[_66_] Excel Programming 7 May 1st 08 07:15 PM
Identify non-alphanumeric characters within a cell in Excel [email protected] Excel Programming 3 August 20th 06 10:40 PM
format cell to place colon btw every 2 alphanumeric characters hogsy Excel Worksheet Functions 0 August 17th 06 03:30 PM
Search for non alphanumeric characters jmdaniel Excel Programming 14 February 21st 06 09:08 PM


All times are GMT +1. The time now is 11:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"