ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MACRO for copying active sheet without using a certain name (https://www.excelbanter.com/excel-programming/305086-macro-copying-active-sheet-without-using-certain-name.html)

Tami[_4_]

MACRO for copying active sheet without using a certain name
 
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



Norman Jones

MACRO for copying active sheet without using a certain name
 
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.


---
Regards,
Norman


"Tami" wrote in message
...
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





Tami[_4_]

MACRO for copying active sheet without using a certain name
 
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
"Norman Jones" wrote in message
...
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.


---
Regards,
Norman


"Tami" wrote in message
...
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







Norman Jones

MACRO for copying active sheet without using a certain name
 
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



"Tami" wrote in message
...
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
"Norman Jones" wrote in message
...
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.


---
Regards,
Norman


"Tami" wrote in message
...
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










All times are GMT +1. The time now is 08:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com