Worksheet Name as a Variable

  • Thread starter Thread starter HamishM
  • Start date Start date
H

HamishM

Hi,

How do I use the name of the current worksheet i am in as a variabl
within a formula?

e.g.

IF value in column H = 'worksheet_name' return 'worksheet_name' a
value in cell x.

thanks,
Hamis
 
You can use these formulas to extract data relating to your workbook. The
one you want is last in the list.

The file path and name
CELL("filename",A1)

The file path
LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1),1)-1)

The file name
MID(CELL("filename",A1),FIND("[",CELL("filename",A1),1)+1,FIND("]",CELL("fil
ename",A1),1)-FIND("[",CELL("filename",A1),1)-1)

The sheet name
RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-FIND("]",CELL("filename",
A1),1))

--

Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"
 
Back
Top