Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
"Find" a wildcard as a place marker and "replace" with original va | Excel Discussion (Misc queries) | |||
"Center across selection" rather than "Merge cells" | Excel Discussion (Misc queries) | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Icon for "Wrap" and for "Centre Across Selection" | Excel Worksheet Functions |