Hi,
I have a VBA to create a new tab and also create a PDF of the page too, as well as protecting the new tab sheet. What I am trying to do is add to this VBA so that the new tab colour is different from original. I want to do this as I want to hide all the created tabs and leave the first 2 original tabs in view.
This is what I have so far
Sub AddSheet()
Dim ws As Worksheet
Dim wh As Worksheet
Set ws = Worksheets(ActiveSheet.Name)
ActiveSheet.Copy After:=Worksheets(Sheets.Count)
ws.Tab.Color = 6
Set wh = Worksheets(Sheets.Count)
If ws.Range("e9").Value <> "" Then
wh.Name = ws.Range("E9").Value
ActiveSheet.Protect
End If
strPath = ActiveWorkbook.Path & "\Invoices\"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=strPath & Range("E9"), _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub
Hope someone can help
I have a VBA to create a new tab and also create a PDF of the page too, as well as protecting the new tab sheet. What I am trying to do is add to this VBA so that the new tab colour is different from original. I want to do this as I want to hide all the created tabs and leave the first 2 original tabs in view.
This is what I have so far
Sub AddSheet()
Dim ws As Worksheet
Dim wh As Worksheet
Set ws = Worksheets(ActiveSheet.Name)
ActiveSheet.Copy After:=Worksheets(Sheets.Count)
ws.Tab.Color = 6
Set wh = Worksheets(Sheets.Count)
If ws.Range("e9").Value <> "" Then
wh.Name = ws.Range("E9").Value
ActiveSheet.Protect
End If
strPath = ActiveWorkbook.Path & "\Invoices\"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=strPath & Range("E9"), _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub
Hope someone can help