Hey guys first post, sorry for any transgressions. So, I'm trying to copy the results from a pivot table to a new tab that is created and named by the macro. The problem is coming with the creation and naming of the tab. After the first run it returns with an out of range function. I understand this is because when I recorded the macro it set the new tab as "Sheet2" and the new sheets are going to be "sheets3"etc. My seconded question is it possible to name a new tab from the contents from a cell in the pivot table. Is this possible?
Here is what I have so far.
Here is what I have so far.
Code:
Sub Attempt1()
'
' Attempt1 Macro
'
'
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Questions").Select
Range("B2").Select
Selection.Copy
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "ATM"
Sheets("Questions").Select
Range("A4:C6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("ATM").Select
Range("C1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Questions").Select
Application.CutCopyMode = False
Range("C5").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
End Sub
Last edited by a moderator: