Hi,
In VBA you can use this function:
The function FindSheetName("String to find in C1") will return the name
of the sheet.
Code:
--------------------
Sub Main()
MsgBox FindSheetName("fr")
End Sub
Function FindSheetName(NameStr As String) As String
Dim x As Integer
FindSheetName = "Not Found!"
For x = 1 To ActiveWorkbook.Sheets.Count
If Sheets(x).Cells(1, 3) = NameStr Then
FindSheetName = Sheets(x).Name
End If
Next x
End Function
--------------------
Charlie
'Opener Consulting Home' ('Opener Consulting Home' (
http://www.openerconsulting.com))
John;184098 Wrote:
=MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)
that's the formula offered in the "Look at this" you offered. It makes
no sense to me. What does "filename" refer to? What is the "]" for?
I want to find where the string "John G" is in a workbook and then
save
the name of the worksheet and the location of the cell. What has that
got to do with the formula above?
I found this formula before and it just baffled me. I've never seen an
example of it's use... only the formula.
Thanks
John
ryguy7272 wrote:
Maybe this:
Private Sub Workbook_Open()
Sheets("Sheet1").Activate
End Sub
It needs to go in 'ThisWorkbook', object.
Also, take a look at this:
'Cell Function Returns Sheet Name, Workbook Name and Path'
('Cell Function Returns Sheet Name, Workbook Name and Path' (
http://tinyurl.com/72rxjh))
Remember, you have to save your WB before the change becomes
effective.
Regards,
Ryan---