Dear Someone,
Please, can someone help me with this?
I am trying to change the footer base on a cell range in a worksheet, everything works fine, except that one workbook contains a chart. Type mismatched is the error, which I know, that because of the chart and that I didn't declare it like the worksheet. I am trying to fix it through, but can't seem to know the correct code. Please help me. Below is my code.
Private SubWorkbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Dim sht As Worksheet
For Each sht In Sheets
sht.PageSetup.CenterFooter ="&""Calibri,Regular""&6&K01+024Ref:&F" & Space(30) &"&""Calibri,Regular""&6&K01+024Date ofIssue: " & Worksheets(1).Range("N16").Text
Range("N16").NumberFormat= "dd mmm yyyy"
sht.PageSetup.RightFooter= "&""Calibri,Regular""&6&K01+024Page&P of &N"
Next
Sheet9.PageSetup.CenterFooter= ""
Sheet9.PageSetup.RightFooter= ""
End Sub
Thank you very much
Please, can someone help me with this?
I am trying to change the footer base on a cell range in a worksheet, everything works fine, except that one workbook contains a chart. Type mismatched is the error, which I know, that because of the chart and that I didn't declare it like the worksheet. I am trying to fix it through, but can't seem to know the correct code. Please help me. Below is my code.
Private SubWorkbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Dim sht As Worksheet
For Each sht In Sheets
sht.PageSetup.CenterFooter ="&""Calibri,Regular""&6&K01+024Ref:&F" & Space(30) &"&""Calibri,Regular""&6&K01+024Date ofIssue: " & Worksheets(1).Range("N16").Text
Range("N16").NumberFormat= "dd mmm yyyy"
sht.PageSetup.RightFooter= "&""Calibri,Regular""&6&K01+024Page&P of &N"
Next
Sheet9.PageSetup.CenterFooter= ""
Sheet9.PageSetup.RightFooter= ""
End Sub
Thank you very much