Hello Guys,
I have been using the following code for some time and is working perfect.
Now, I want to add another function. The files have a name in the format "Sandy yy-mm-dd" where "Sandy" is the constant part. I want it to auto save the file after it has done all of the above with name format "Sandy yy-mm-dd" and yy-mm-dd has to be taken from cell "AL3" in sheet named "ROSTER". The path will be - "E:\2011\Sandy yy-mm-dd".
Can this be done?
Asad
I have been using the following code for some time and is working perfect.
Code:
Sub Rotation()
'
' Macro1 Macro
' Macro recorded 9/10/2009 by Ali
'
'
Columns("AM:AU").Select
Selection.EntireColumn.Hidden = False
Range("AS8:AS39").Select
Selection.ClearContents
Range("AL2").Select
Selection.Copy
Range("AL3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A8:C50").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("E8:F23").Select
Selection.Copy
Range("E9:F24").Select
ActiveSheet.Paste
Range("E24:F24").Select
Selection.Copy
Range("E8:F8").Select
ActiveSheet.Paste
Range("E24:F24").Select
Application.CutCopyMode = False
Selection.ClearContents
ActiveWindow.SmallScroll Down:=6
Range("E31:F38").Select
Selection.Copy
Range("E32:F39").Select
ActiveSheet.Paste
Range("E39:F39").Select
Selection.Copy
Range("E31").Select
ActiveSheet.Paste
Range("E39:F39").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("E42:F48").Select
Selection.Copy
Range("E43:F49").Select
ActiveSheet.Paste
Range("E49:F49").Select
Selection.Copy
Range("E42").Select
ActiveSheet.Paste
Range("E49:F49").Select
Application.CutCopyMode = False
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-12
Range("AS7").Select
Selection.AutoFill Destination:=Range("AS7:AS38"), Type:=xlFillDefault
Range("AS7:AS38").Select
ActiveWindow.SmallScroll Down:=-9
Range("G8:G38").Select
Selection.ClearContents
Range("G16").Select
ActiveCell.FormulaR1C1 = "RELIEF"
Range("G22").Select
ActiveCell.FormulaR1C1 = "RELIEF"
Range("A7:C7").Select
Selection.AutoFill Destination:=Range("A7:C50"), Type:=xlFillDefault
Range("A7:C50").Select
ActiveWindow.SmallScroll Down:=-18
Columns("AN:AT").Select
Selection.EntireColumn.Hidden = True
Range("G3").Select
ActiveSheet.Shapes("Button 32").Select
Range("G3").Select
End Sub
Now, I want to add another function. The files have a name in the format "Sandy yy-mm-dd" where "Sandy" is the constant part. I want it to auto save the file after it has done all of the above with name format "Sandy yy-mm-dd" and yy-mm-dd has to be taken from cell "AL3" in sheet named "ROSTER". The path will be - "E:\2011\Sandy yy-mm-dd".
Can this be done?
Asad