spflash
05-26-2006, 10:08 AM
Hi All,
Using the code below I'm attempting to rename my worksheet by using a string (or number) contained in cell E4 for example that's present on the same active sheet. The loop steps through a pivot table to create a new sheet for each consecutive cell selected. After each new sheet is created, I'd like to rename it using the string (or number) contained in cell "E4". So far I've had no success with the code below. Can anyone help me with this stumbling block? Thanks.
spflash
:banghead:
Sub PivotTable
Dim TB As Worksheet
Dim FinalRow As Long
ActiveSheet.Name = "PivotTable"
For i = 5 To Final Row
Cells(i, 3).Select
Selection.ShowDetail = True
Active Sheet.Name=TB.Range ("E4")
Sheets ("PivotTable").Select
Next i
End Sub
Using the code below I'm attempting to rename my worksheet by using a string (or number) contained in cell E4 for example that's present on the same active sheet. The loop steps through a pivot table to create a new sheet for each consecutive cell selected. After each new sheet is created, I'd like to rename it using the string (or number) contained in cell "E4". So far I've had no success with the code below. Can anyone help me with this stumbling block? Thanks.
spflash
:banghead:
Sub PivotTable
Dim TB As Worksheet
Dim FinalRow As Long
ActiveSheet.Name = "PivotTable"
For i = 5 To Final Row
Cells(i, 3).Select
Selection.ShowDetail = True
Active Sheet.Name=TB.Range ("E4")
Sheets ("PivotTable").Select
Next i
End Sub