Pasting a Name on a Tab through a Macro

squeakums

Well-known Member
Joined
May 15, 2007
Messages
823
Office Version
  1. 365
I can't seem to figure out how to paste a name onto a tab in vba. In regular excel I can use use the ctrl and v option. But, how would you write to paste a copied name on a tab through a macro?

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 3/21/2009 by test
'

'
Windows("Test's Team (Individual Monthly).xls").Activate
Sheets("Template").Select
Sheets("Template").Copy After:=Sheets(1)
Windows("Test's Team (By Group).xls").Activate
Sheets("Monthly Logged Details").Select
Range("A2").Select
Selection.Copy
Windows("Test's Team (Individual Monthly).xls").Activate
ActiveSheet.Paste
Sheets("Template (2)").Select
Sheets("Template (2)").Pastevalues
Range("A1:N1").Select
Windows("Macro.xls").Activate
Range("A1").Select
End Sub
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
That will name the tab - whatever new name. I would like for it to paste a name that I copied. How would I do that?
 
Upvote 0

Forum statistics

Threads
1,218,946
Messages
6,145,378
Members
450,613
Latest member
Chalky1982

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top