Good Afternoon,
Can anyone please assist in displaying the tab name in a cell value. I need to tab name to automatically update without having to manually run any macros.
I've tried using the following equation
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
which works... however I notice whenever I, or another user, start the workbook the cell's value appears as "#VALUE!". So I've turned to VBA to automatically update the value of the cell. I have a working code that updates the value of cell "AU9" however I have to manually run it each time. Is there a way to have this code automatically display the value? Ideally I would like to change the tab name and see the changes immediately as the value displayed is the driving force for a series of vlookups and data validations in another tab.
Private Sub TabName()
Dim wsname As String
wsname = ActiveSheet.name
Range("au9") = wsname
End Sub
Can anyone please assist in displaying the tab name in a cell value. I need to tab name to automatically update without having to manually run any macros.
I've tried using the following equation
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
which works... however I notice whenever I, or another user, start the workbook the cell's value appears as "#VALUE!". So I've turned to VBA to automatically update the value of the cell. I have a working code that updates the value of cell "AU9" however I have to manually run it each time. Is there a way to have this code automatically display the value? Ideally I would like to change the tab name and see the changes immediately as the value displayed is the driving force for a series of vlookups and data validations in another tab.
Private Sub TabName()
Dim wsname As String
wsname = ActiveSheet.name
Range("au9") = wsname
End Sub