Solved

if it can't be found end sub

Posted on 2014-03-19
2
197 Views
Last Modified: 2014-03-19
I am using the below code to find text. What I need is to say if the word[s] cannot be found End Sub. Can an expert provide me with the additional code that will do this please.

Rows("1:" & Cells.Find("Open and Closed").Row - 1).Delete

Thanks
0
Comment
Question by:Jagwarman
2 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 39939004
Dim FoundCell As Range
Set FoundCell = Cells.Find("Open and Closed")
If FoundCell Is Nothing Then Exit Sub
Rows("1:" & FoundCell.Row - 1).Delete

Kevin
0
 

Author Closing Comment

by:Jagwarman
ID: 39939009
Thanks Kevin exactly what I wanted.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now