![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Boston, MA
Posts: 105
|
What is the best way to pass the row number where a string can be found to a variable?
Example, in Column A I have a list of countries. I want CntryRow to equal the row where CHE is found. I've been relying on the Find method, but it seems to slow things down on a grand scale because I end up with code like: Sheets("Sheet1").Select Columns("A:A").Select Selection.Find(What:="CHE").Activate I've tried combining the last two lines, but it does not always work, and I cannot use it to on an inactive sheet. Any suggestions? |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
Quote:
This code will only work if "CHE" exists in Column A. HTH |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|