liamwhan
04-23-2012, 06:47 PM
Hi all
I'm sure someone will take about 2 seconds to solve this but I've been hitting my head against a wall for hours :banghead:
I'm trying to copy a Worksheet and Rename it based on the Value of a Cell in the Active Sheet when a CommandButton on the Sheet in question is pressed.
Private Sub CommandButton1_Click()
Dim MySheetName As String
MySheetName = ActiveSheet.Range("B5") & "Selection Report"
ActiveWorkbook.Sheets("Selection Report").Copy _
after:=ActiveWorkbook.Sheets("Selection Report")
ActiveSheet.Name = MySheetName
End Sub
Any help would be geatly apprecaited!
I'm sure someone will take about 2 seconds to solve this but I've been hitting my head against a wall for hours :banghead:
I'm trying to copy a Worksheet and Rename it based on the Value of a Cell in the Active Sheet when a CommandButton on the Sheet in question is pressed.
Private Sub CommandButton1_Click()
Dim MySheetName As String
MySheetName = ActiveSheet.Range("B5") & "Selection Report"
ActiveWorkbook.Sheets("Selection Report").Copy _
after:=ActiveWorkbook.Sheets("Selection Report")
ActiveSheet.Name = MySheetName
End Sub
Any help would be geatly apprecaited!