Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Removing all rows that contain letters

I'm trying to remove all rows that contain letters, using a macro. I hope
this is easily possible. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Removing all rows that contain letters

Dim rng as Range
On Error Resume Next
set rng = Cells.SpecialCells(xlConstants,xlTextValues)
rng.EntireRow.Delete
set rng = Cells.SpecialCells(xlForulas,xlTextValues)
rng.EntireRow.Delete
On Error goto 0
--
Regards,
Tom Ogilvy

"fred" wrote in message
...
I'm trying to remove all rows that contain letters, using a macro. I hope
this is easily possible. Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Removing all rows that contain letters

here is a fixed version:

Sub DeleteRowsWithText()
Dim rng As Range
On Error Resume Next
With ActiveSheet
Set rng = .Cells.SpecialCells(xlConstants, xlTextValues)
Intersect(rng.EntireRow, .Rows).Delete
Set rng = .Cells.SpecialCells(xlFormulas, xlTextValues)
Intersect(rng.EntireRow, .Rows).Delete
End With
On Error GoTo 0
End Sub


--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
Dim rng as Range
On Error Resume Next
set rng = Cells.SpecialCells(xlConstants,xlTextValues)
rng.EntireRow.Delete
set rng = Cells.SpecialCells(xlForulas,xlTextValues)
rng.EntireRow.Delete
On Error goto 0
--
Regards,
Tom Ogilvy

"fred" wrote in message
...
I'm trying to remove all rows that contain letters, using a macro. I

hope
this is easily possible. Thanks





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
Removing up to 3 last letters, excel [email protected] Excel Discussion (Misc queries) 1 June 28th 07 09:26 PM
all my top rows are now numbers, how to set it back to letters Holly Excel Discussion (Misc queries) 2 September 15th 06 05:08 PM
How can I switch so that rows are referenced with letters, and co. willyv1 Excel Discussion (Misc queries) 1 March 17th 05 06:53 PM
My rows switched to having numbers instead of letters. EJ New Users to Excel 2 February 7th 05 09:32 PM
trouble removing rows Spork Rhonewood[_4_] Excel Programming 1 June 23rd 04 04:46 PM


All times are GMT +1. The time now is 02:40 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"