Trùng hợp mình vừa làm hôm qua. để căn trang in như hình. Rồi sài code
Sub PrintAreapersonalTraning()
Dim n As Integer
For n = 1 To 10000
If Cells(Cells(Rows.Count, "C").End(xlUp).Row - n, "Q").Value = "" Then
ActiveSheet.PageSetup.PrintArea = Range([A1], Cells(Cells(Rows.Count, "C").End(xlUp).Row - n + 1, "Q")).Address
ElseIf Cells(Cells(Rows.Count, "C").End(xlUp).Row - n, "C").Value <> "" Then
ActiveSheet.PageSetup.PrintArea = Range([A1], Cells(Cells(Rows.Count, "C").End(xlUp).Row - n + 1, "Q")).Address
Exit For
End If
Next n
End Sub