Asking for help to have a macro to change cell C9 to customer name in cell T3, then print to pdf. Once printed, change cell C9 to customer name in T4 and print to pdf. I have the printind to pdf working, but changing cell value is messing me up. Any help would be appricated.
Cell C9 currently selected:
Sub Print_Sheet()
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, ActiveCell) Is Nothing Then
ActiveCell.Value = Sheets("sheet name").Range("t4")
End If
ChDir "Change to directory & folder wanting to save pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"Change to directory & folder wanting to save pdf\" & Range("U1").Text & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
If Not Intersect(Target, ActiveCell) Is Nothing Then
ActiveCell.Value = Sheets("sheet name").Range("t5")
End If
ChDir "Change to directory & folder wanting to save pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"Change to directory & folder wanting to save pdf\" & Range("U1").Text & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
End Sub
Cell C9 currently selected:
Sub Print_Sheet()
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, ActiveCell) Is Nothing Then
ActiveCell.Value = Sheets("sheet name").Range("t4")
End If
ChDir "Change to directory & folder wanting to save pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"Change to directory & folder wanting to save pdf\" & Range("U1").Text & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
If Not Intersect(Target, ActiveCell) Is Nothing Then
ActiveCell.Value = Sheets("sheet name").Range("t5")
End If
ChDir "Change to directory & folder wanting to save pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"Change to directory & folder wanting to save pdf\" & Range("U1").Text & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
End Sub