Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Need Help With Code Quick!!

The clue is to decide if you want to do two searches or one and if that ends
up blank then another. That determins to in clude in end if statement or
not.
Carl


"Tom Ogilvy" wrote in message
...
Guess you didn't write any of this code, because it is pretty much is set

up
to act the way you describe.


Dim oFound as Range
Set ofound = Columns(1).Find(WHAT:="EXT", _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=True)
If Not ofound Is Nothing Then
' this is only run if EXT is found
ofound.Activate
If Trim(ofound) = "EXT" Then
ActiveCell.Offset(rowOffset:=0, columnOffset:=4).Activate
Selection.Copy
Windows("BOOK1.XLS").Activate
Range("D3").Select
ActiveSheet.Paste
Application.goto oFound
End if ' trim(ofound) = "EXT"
End if ' Not ofound is Nothing

the test, IF not ofound is nothing then
only does the above copy and paste if a cell with EXT was found in column

1.
Otherwise it drops down to the End If and if the code after that is

another
search, it would do that.

I indented the code in the If Then; End if block to make that clearer.

--
Regards,
Tom Ogilvy


"alexm999 " wrote in message
...
Works Great thanks!

But...

What if the word EXT is not there? depending on the day, EXT may not
show up. how can i get it to search for EXT and then if not found, move
on to the next search, but if found run the script i listed above..


---
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
Quick Code Nimish Excel Discussion (Misc queries) 3 September 11th 06 07:19 PM
Quick! Help With Code Formatting! alexm999[_83_] Excel Programming 1 June 23rd 04 10:20 PM
quick code request michelle Excel Programming 1 June 23rd 04 09:59 AM
quick code question dave!! Excel Programming 2 May 18th 04 04:56 PM
Is there a quick way to see which objects have code attached? Terri[_4_] Excel Programming 2 September 12th 03 05:11 PM


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