Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to rename "Emp1" to "NewData". Here is my code.
Private Sub Send1_Click() Dim strDate As String Sheets(Array("Emp1", "Main")).Copy strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss") ActiveWorkbook.SaveAs "NewEmployeeData.xls" ActiveWorkbook.SendMail "", _ "Employee Attendance Data" ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName ActiveWorkbook.Close False End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Send1_Click()
Dim strDate As String, sName as STring Sheets(Array("Emp1", "Main")).Copy strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss") Worksheets("Emp1").Name = "NewData" ActiveWorkbook.SaveAs "NewEmployeeData.xls" ActiveWorkbook.SendMail "", _ "Employee Attendance Data" sname = ActiveWorkbook.Fullname ActiveWorkbook.Close False Kill sName End Sub -- Regards, Tom Ogilvy "Qaspec" wrote in message ... I want to rename "Emp1" to "NewData". Here is my code. Private Sub Send1_Click() Dim strDate As String Sheets(Array("Emp1", "Main")).Copy strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss") ActiveWorkbook.SaveAs "NewEmployeeData.xls" ActiveWorkbook.SendMail "", _ "Employee Attendance Data" ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName ActiveWorkbook.Close False End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Qaspec
Use this Sheets(Array("Emp1", "Main")).Copy Sheets("Emp1").Name = "NewData" -- Regards Ron de Bruin http://www.rondebruin.nl "Qaspec" wrote in message ... I want to rename "Emp1" to "NewData". Here is my code. Private Sub Send1_Click() Dim strDate As String Sheets(Array("Emp1", "Main")).Copy strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss") ActiveWorkbook.SaveAs "NewEmployeeData.xls" ActiveWorkbook.SendMail "", _ "Employee Attendance Data" ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName ActiveWorkbook.Close False End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Rename Many Worksheets at a time. | Excel Discussion (Misc queries) | |||
How do you copy and rename linked worksheets? | Excel Discussion (Misc queries) | |||
Can I batch rename new worksheets | New Users to Excel | |||
Rename Worksheets to Sequential Dates | Excel Programming | |||
Mass rename of worksheets/Workbooks | Excel Programming |