Dear All,
I hope someone can be of assistance. I have the following code which worked perfectly, but all of a sudden it is putting the result next to the page number in the right part of the footer. I do not understand why it does this? The code is
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim C103 As String
Dim result As String
C103 = Sheets("Client info").Range("C103").Text
If C103 = "Large Enterprise" Then
result = "AVSLSAR-03"
ElseIf C103 = "Qualifying Small Enterprise" Then
result = "AVSQSAR-03"
ElseIf C103 = "Agri Charter - Large Enterprise" Then
result = "AVSALSAR-01"
ElseIf C103 = "Agri Charter - QSE" Then
result = "AVSAQSAR-01"
ElseIf C103 = "Tourism Charter - Large Enterprise" Then
result = "AVSTLSAR-01"
ElseIf C103 = "Tourism Charter - QSE" Then
result = "AVSTQSAR-01"
ElseIf C103 = "MAC Charter - Large Enterprise" Then
result = "AVSMLSAR-01"
ElseIf C103 = "MAC Charter - QSE" Then
result = "AVSMQSAR-01"
ElseIf C103 = "ICT Charter - Large Enterprise" Then
result = "AVSICTLSAR-01"
ElseIf C103 = "ICT Charter - QSE" Then
result = "AVSICTQSAR-01"
Else
result = ""
End If
With ActiveSheet.PageSetup
.LeftFooter = result
End With
End Sub
For example, when I choose "Large Enterprise", instead of "AVSLSAR-03" being inserted in the left side of the footer, it is added next to the page number and looks something like "Page 1&AVSLSAR-03". This should not be like this and I do not understand why this is happening. Any assistance would be greatly appreciated.
Bookmarks