![]() |
![]() |
|
|||||||
| 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: Apr 2002
Posts: 76
|
Hi, I have a sheet that contains a number of words. What I want is to put a formula in that will look down the sheet and if a criteria is met, to return the column number. Can anyone help? |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
|
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Location: Midlands, UK
Posts: 217
|
Hi Buntykins,
I can't help but feel a little strange typing that & yuo're not my wife Anyway - try this : Sub Macro1() Range("a1:a10").Select myran = Selection.Find(What:="lewis", After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _ MatchCase:=False).Row Range("d1").Value = myran End Sub This looks for "Lewis" in A1 to A10 & returns the row number in cell D1 HTH, Iain |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|