LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default If Cannot find skip???

Hi,

I have built a report that pulls in information from another
spreadsheet. The information I take from this spread sheet can be in
various locations on the spreadsheet and therefore I'm unable to point
to a specific cell.

As each piece of information that I take from the sheet has a title, I
have used the recorder to find the specific titles. However there is
one part of the spreadsheet that does not always come through it
depends if the user has selected it. This is where my report is falling
over its basically saying find e.g. Street Address and as it can't find
it it is debugging.

What I want it to do is find street address if its there then carry on
with the code if not then skip to the next part. I have tried an IF but
I must be doing it wrong as I cant get it to work.

I have copied the part of the code I have recorded below as this may
assist:

It would be good if I could wrap something around it saying that if it
cant find "Street Address" then skip this part.

Cells.Find(What:="Street Address", After:=ActiveCell,
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
_
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(rowoffset:=4, columnoffset:=0).Select
Range(Selection, Selection.Offset(15, 0)).Select
Selection.Copy
Windows("Book1.xls").Activate
Worksheets("Sheet1").Select
Range("A1").Select
ActiveSheet.Paste
Selection.TextToColumns Destination:=Range("A1"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=False, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False,
FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1),
Array(5, 1), Array(6, 1), _
Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11,
1), Array(12, 1), Array(13, 1 _
), Array(14, 1), Array(15, 1), Array(16, 1), Array(17, 1),
Array(18, 1), Array(19, 1), Array _
(20, 1), Array(21, 1), Array(22, 1), Array(23, 1), Array(24,
1), Array(25, 1), Array(26, 1), _
Array(27, 1), Array(28, 1)), TrailingMinusNumbers:=True
Range("A1").Select

Any help would be much appriciated

Many Thanks

 
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
using IF to skip Julie Excel Worksheet Functions 4 March 14th 08 10:21 PM
Can I skip all these questions? grok Excel Discussion (Misc queries) 2 November 17th 06 06:13 PM
skip blanks Robin Krupp Excel Worksheet Functions 6 April 4th 06 01:46 PM
Skip a day of the week Flintstone Excel Discussion (Misc queries) 4 June 6th 05 02:31 PM
skip worksheet davegb Excel Programming 6 May 11th 05 12:01 PM


All times are GMT +1. The time now is 06:36 AM.

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

About Us

"It's about Microsoft Excel"