A
Atishoo
Hi
Am using an open event to calculate if a date on a page has passed if so it
coppies the page to another workbook for archiving.
I want to change the name of the worksheet copied to the date that has
passed (a date value contained within a cell. The date value is formatted to
2-feb-2009 but it still returns error message on this!
any ideas??
Private Sub Workbook_Open()
If Worksheets("sheet3").Range("k4").Value >
Worksheets("sheet3").Range("k9").Value Then
Workbooks.Open Filename:="AOT Weekend Duties Record.XLS"
Workbooks("weekend duties2").Worksheets("Sheet2").Copy
after:=Workbooks("AOT Weekend Duties Record.xls").Worksheets("Sheet1")
Workbooks("AOT Weekend Duties Record.xls").Worksheets("sheet2").Name
= Workbooks("weekend duties2").Worksheets("sheet3").Range("k9").Value
Workbooks("AOT Weekend Duties Record.xls").Close
Worksheets("sheet3").Range("k9").Value =
Worksheets("sheet3").Range("k8").Value
End If
End Sub
Am using an open event to calculate if a date on a page has passed if so it
coppies the page to another workbook for archiving.
I want to change the name of the worksheet copied to the date that has
passed (a date value contained within a cell. The date value is formatted to
2-feb-2009 but it still returns error message on this!
any ideas??
Private Sub Workbook_Open()
If Worksheets("sheet3").Range("k4").Value >
Worksheets("sheet3").Range("k9").Value Then
Workbooks.Open Filename:="AOT Weekend Duties Record.XLS"
Workbooks("weekend duties2").Worksheets("Sheet2").Copy
after:=Workbooks("AOT Weekend Duties Record.xls").Worksheets("Sheet1")
Workbooks("AOT Weekend Duties Record.xls").Worksheets("sheet2").Name
= Workbooks("weekend duties2").Worksheets("sheet3").Range("k9").Value
Workbooks("AOT Weekend Duties Record.xls").Close
Worksheets("sheet3").Range("k9").Value =
Worksheets("sheet3").Range("k8").Value
End If
End Sub