# Microsoft Office Application Help - Excel Help forum > Excel Programming / VBA / Macros >  >  Rename worksheet name "Sheet1" in VBA

## skchow

How to rename the worksheet name "Sheet1" to "File1" in VBA?
My VBA coding as follows:
Sub Copyfile()
FileCopy ("C:\Data2006.xls"), C:\Book1.xls
End Sub

----------


## davesexcel

here are four codes you can use

Sub Macro2()
'
  ActiveSheet.Name = "File1"
End Sub
Sub Macro3()
'
  ActiveSheet.Name = Range("a1")
    End Sub
Sub Macro6()
'
  Sheets(1).Name = "File1"
End Sub
Sub Macro7()
'
  Sheets(1).Name = Sheets(2).Range("A1")
    End Sub

----------


## Roger Govier

Hi

If you use Workbooks.Add 1 then you will create a new workbook with just 1 sheet, which you can then delete at the end.
Maybe something like




```
Please Login or Register  to view this content.
```

----------

