Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default FIND A TEXT IN A WORKSHEET NOT IN A COLUMN OR ROW BY FORMULA

By coincidence, I posted this code yesterday:

This code looks for the string "asdf" in the current worksheet and
displays a message box with the address when it is found. If the
string is not found it advises the user, as well. You can substitute
your search string as a variable or as a hardcoded entry.

Note this Usenet interface word wraps, so you may need to adjust the
line breaks.

Sub Find()
On Error GoTo NotFound:
Cells.Find(What:="asdf", After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate


MsgBox ActiveCell.Address
End


NotFound:
MsgBox ("Search target not found.")


End Sub

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
Formula to copy text from a column in different workshhets TheTomo Excel Worksheet Functions 2 January 13th 06 04:09 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula to lookup Multiple Column Text and then Count Result ShelbyMan Excel Worksheet Functions 2 August 22nd 05 01:43 AM
Search column and move text formula tommy Excel Discussion (Misc queries) 0 February 8th 05 06:55 PM


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