Find within a file as a function

M

MACRE0

Cell J22 generally contains the text "Project Name:" within a template.
But people mess with their files and this is not always the case. Als
it was not previously defined as Project Name (and since I can'
expect everyone to download a new template, can't be). What I woul
like to do is be able to have a seperate file search through th
template to locate this cell and enter the information directly below.
I'm also not allowed to use a macro here. If however a macro is th
only way, I'll take any assistance you can provide. Thank you
 
D

Dave Peterson

I think you'll need a macro.

Maybe something like:

Option Explicit
Sub testme01()

Dim FoundCell As Range
Dim FindWhat As String

FindWhat = "Project Name:"

With ActiveSheet.UsedRange
Set FoundCell = .Cells.Find(What:=FindWhat, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

If FoundCell Is Nothing Then
MsgBox "not found"
Else
FoundCell.Offset(1, 0).Value = "someinformationthatyoudidn'tshare"
End If
End With

End Sub
 
Top