Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find method
Try this
Sub Find_First() Dim FindString As String Dim Rng As Range FindString = InputBox("Enter a Search value") If Trim(FindString) < "" Then Set Rng = Cells.Find(What:=FindString, _ After:=Range("IV" & Rows.Count), _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not Rng Is Nothing Then MsgBox Rng.Column Else MsgBox "Can't find the word" End If End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "benb" wrote in message ... I want to search an entire sheet for a cell containing a value then return the column number for that cell. I have tried variations of n=Activesheet.Find ([value], LookIn: xlValues, LookAt: xlWhole).Column, but any adaption I try gets a compile error. Any help? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
find method? | Excel Programming | |||
Find method example | Excel Programming | |||
The find method | Excel Programming | |||
Help with the Find method | Excel Programming | |||
The Find Method | Excel Programming |