Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default selection.find shortening the procedure by skipping the "activate" part

Hello everyone,

In a macro I have this piece of code of which I know a shorter version can
be implemented (but I don't know how exactly). It has to do something with
omitting the "activate" part of it, and directly placing the desired values
(the row and column numbers) into the variables, I believe by using the Set
statement. Exactly how, I'd like to know from you:

Code:
For Element = 1 To UBound(IDs)
Range("B3:B1000").Select
Selection.Find( _
What:=IDs(Element), _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False).Activate

r = ActiveCell.Row

Rows(2).Select
Selection.Find( _
What:=Month, _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False).Activate

c = ActiveCell.Column

usage: both win xp/office 2003 (home) and
win2000 / office2000 (at the office)

TIA,
Peter.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default selection.find shortening the procedure by skipping the "activate" part


Peter


Is this what you are after


r = Range("B3:B1000").Find( _
What:=IDs(Element), _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False).Ro

--
mudrake
-----------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...nfo&userid=247
View this thread: http://www.excelforum.com/showthread.php?threadid=27722

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
"Find" a wildcard as a place marker and "replace" with original va Eric Excel Discussion (Misc queries) 1 January 27th 09 06:00 PM
"Center across selection" rather than "Merge cells" Elardus Excel Discussion (Misc queries) 10 November 6th 08 02:28 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Icon for "Wrap" and for "Centre Across Selection" BeSmart Excel Worksheet Functions 2 November 16th 05 06:44 PM


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