Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete rows that don't contain '+' or '++'

My excel file has multiple rows and columns.
I need to delete all the rows that don't have at least
one cell with "+" or "++"
I would appreciate any sample VB code

Thank yo

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Delete rows that don't contain '+' or '++'

Hi esexcel

Try this one for row 1 -100

Sub Example2()
Dim Lrow As Long
Dim CalcMode As Long
Dim StartRow As Long
Dim EndRow As Long
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

With ActiveSheet
.DisplayPageBreaks = False
StartRow = 1
EndRow = 100
For Lrow = EndRow To StartRow Step -1
If Application.WorksheetFunction.CountIf(.Rows(Lrow), "*+*") = 0 _
Then .Rows(Lrow).Delete
Next
End With
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"esexcel " wrote in message ...
My excel file has multiple rows and columns.
I need to delete all the rows that don't have at least
one cell with "+" or "++"
I would appreciate any sample VB code

Thank you


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete rows that don't contain '+' or '++'

Thanks Ron

It worked!

However, I need only to display these values "+" "++" and "+++"
The way that the code is it also displays "+-"
What should I do?

Thanks agai

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete rows that don't contain '+' or '++'

Hi Ron

Nevermind. I replaced the +- values with something else, that way I ca
run the script without modifying it

Thank

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Delete rows that don't contain '+' or '++'

Thanks for your feedback
I don't have to make a example for you then

--
Regards Ron de Bruin
http://www.rondebruin.nl


"esexcel " wrote in message ...
Hi Ron

Nevermind. I replaced the +- values with something else, that way I can
run the script without modifying it

Thanks


---
Message posted from http://www.ExcelForum.com/



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
Hpw do I delete multiple empty rows found between filled rows? Bill Excel Worksheet Functions 2 November 15th 09 07:12 PM
How to Delete empty rows in excel in b/w rows with values Dennis Excel Worksheet Functions 3 August 28th 07 04:15 PM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM
delete empty rows between rows with text Paulo Baptista Excel Discussion (Misc queries) 2 February 28th 05 03:41 PM


All times are GMT +1. The time now is 08:49 PM.

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"