MACRO for copying active sheet without using a certain name

T

Tami

I have been shown a sub for getting a name put to the bottom of the sheet
but I also want to transfer the sheet with a macro to another book. But the
problem I get is the name of the sheet will be different every time.

Any help would be appreciated

Tami
 
N

Norman Jones

Hi Tami,

If you post the sub, I'm sure it can be adapted to suit your purposes.

Alternatively, please explain with a little more detail.
 
T

Tami

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A14")) Is Nothing Then
With Target
Me.Name = .Value
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub
 
N

Norman Jones

Hi Tami,

I am not sure that I follow you,

If you copy the sheet to another workbook, the code will be copied with the
sheet.
In short the no matter the whether the sheet is in its existing workbook or
copied to another workbook. the sheet will be renamed according to the
changes that you make to cell A14, Naturally, any such change will be
reflectted in the sheet's tab.


Regards,
Norman
 
Top