2016-04-01 13 views
-2

誰かがこのExcelマクロを編集するのを手伝ってもらえますか?右のフッターで、現在の日付をmm/dd/yy形式で表示します。Excelに現在の日付を追加する

Sub Document_Standards() 
' 
' Document_Standards Macro 
' 

' 
    ActiveWindow.View = xlPageLayoutView 
    Selection.Font.Size = 12 
    Selection.Font.Size = 14 
    Selection.Font.Bold = True 
    Application.PrintCommunication = False 
    With ActiveSheet.PageSetup 
     .LeftHeader = "" 
     .CenterHeader = "&""-,Bold""&14&F" 
     .RightHeader = "" 
     .LeftFooter = "Created by Chris" 
     .CenterFooter = "CONFIDENTIAL" 
     .RightFooter = "Printed on Date()" 
     .LeftMargin = Application.InchesToPoints(0.7) 
     .RightMargin = Application.InchesToPoints(0.7) 
     .TopMargin = Application.InchesToPoints(0.75) 
     .BottomMargin = Application.InchesToPoints(0.75) 
     .HeaderMargin = Application.InchesToPoints(0.3) 
     .FooterMargin = Application.InchesToPoints(0.3) 
     .Zoom = 100 
     .PrintErrors = xlPrintErrorsDisplayed 
     .OddAndEvenPagesHeaderFooter = False 
     .DifferentFirstPageHeaderFooter = False 
     .ScaleWithDocHeaderFooter = True 
     .AlignMarginsHeaderFooter = True 
     .EvenPage.LeftHeader.Text = "" 
     .EvenPage.CenterHeader.Text = "" 
     .EvenPage.RightHeader.Text = "" 
     .EvenPage.LeftFooter.Text = "" 
     .EvenPage.CenterFooter.Text = "" 
     .EvenPage.RightFooter.Text = "" 
     .FirstPage.LeftHeader.Text = "" 
     .FirstPage.CenterHeader.Text = "" 
     .FirstPage.RightHeader.Text = "" 
     .FirstPage.LeftFooter.Text = "" 
     .FirstPage.CenterFooter.Text = "" 
     .FirstPage.RightFooter.Text = "" 
    End With 
    Application.PrintCommunication = True 
    ActiveSheet.Shapes.Range(Array("Picture 1")).Select 
End Sub 
+1

あなたはRightFooter.Text' 'への値のために' "" '以外のものを試してみましたか? –

+2

'' Printed on Date() ''は '' Printed on "&Date()'にする必要があります。 –

答えて

0

これを試してみてください -

Sub Document_Standards() 
' 
' Document_Standards Macro 
' 

' 
    ActiveWindow.View = xlPageLayoutView 
    Selection.Font.Size = 12 
    Selection.Font.Size = 14 
    Selection.Font.Bold = True 
    Application.PrintCommunication = False 
    With ActiveSheet.PageSetup 
     .LeftHeader = "" 
     .CenterHeader = "&""-,Bold""&14&F" 
     .RightHeader = "" 
     .LeftFooter = "Created by Chris" 
     .CenterFooter = "CONFIDENTIAL" 
     .RightFooter = "Printed on " & Date() 
     .LeftMargin = Application.InchesToPoints(0.7) 
     .RightMargin = Application.InchesToPoints(0.7) 
     .TopMargin = Application.InchesToPoints(0.75) 
     .BottomMargin = Application.InchesToPoints(0.75) 
     .HeaderMargin = Application.InchesToPoints(0.3) 
     .FooterMargin = Application.InchesToPoints(0.3) 
     .Zoom = 100 
     .PrintErrors = xlPrintErrorsDisplayed 
     .OddAndEvenPagesHeaderFooter = False 
     .DifferentFirstPageHeaderFooter = False 
     .ScaleWithDocHeaderFooter = True 
     .AlignMarginsHeaderFooter = True 
     .EvenPage.LeftHeader.Text = "" 
     .EvenPage.CenterHeader.Text = "" 
     .EvenPage.RightHeader.Text = "" 
     .EvenPage.LeftFooter.Text = "" 
     .EvenPage.CenterFooter.Text = "" 
     .EvenPage.RightFooter.Text = "" 
     .FirstPage.LeftHeader.Text = "" 
     .FirstPage.CenterHeader.Text = "" 
     .FirstPage.RightHeader.Text = "" 
     .FirstPage.LeftFooter.Text = "" 
     .FirstPage.CenterFooter.Text = "" 
     .FirstPage.RightFooter.Text = "" 
    End With 
    Application.PrintCommunication = True 
    ActiveSheet.Shapes.Range(Array("Picture 1")).Select 
End Sub 
関連する問題