name tab from cell value
Another question! I have just tried to use the same code on another sheet.
The cell value in this case is in A4, so I changed the code as follows, but
it doesn't appear to work. HOw can I amend the code to use for other sheets?
Option Explicit
Private shname As String
Private Sub Worksheet_Calculate()
If Range("A4").Value < shname Then
shname = [a4].Value
End If
Me.Name = shname
End Sub
Thanks
Denise
"D" wrote:
Thank you so much! This works!!! You are a star and I am deeply impressed
and very grateful.
It is a relief to get it working, and here are a few comments for anyone
else that might want to do this - perhaps a little basic, but hopefully
helpful for relative newbies like me:
Put the code in the sheet first, as the name only changes when the cell is
changed.
Make sure your cell contents don't have unacceptable characters - I changed
the ref. number I'm using from 123/001 to 123-001.
If instructions contain stuff you don't know how to do, like 'add code to
the sheet's module', search for that - I found the answer quite quickly.
D
"GaryDK" wrote:
Hi D,
Try something like this - paste this into the sheet's module:
Option Explicit
Private shname As String
Private Sub Worksheet_Calculate()
If Range("B7").Value < shname Then
shname = [b7].Value
End If
Me.name = shname
End Sub
Hope that helps you,
Gary
|