nsampair1123
New Member
- Joined
- Apr 6, 2023
- Messages
- 5
- Office Version
- 365
- Platform
- Windows
Here is my code. It stops after it prints the first PDF. Can anyone tell me what I am missing that it is not completing the Do Until...Loop?
Sub MeritCommunication()
Dim irow As Integer
Dim EmployeeName As String
Dim EmployeeID As Double
Dim JobTitle As String
Dim CurrentBaseSalary As Double
Dim IncreasePercent As Double
Dim NewBaseSalary As Double
Dim FileName As String
Dim CheckNewBaseSalary As Double
Worksheets("Master Merit").Select
irow = 15
Do Until IsEmpty(Cells(irow, 1))
'Populate Distribution Sheet
Worksheets("Master Merit").Select
EmployeeName = Cells(irow, 2)
EmployeeID = Cells(irow, 1)
JobTitle = Cells(irow, 3)
CurrentBaseSalary = Cells(irow, 5)
IncreasePercent = Cells(irow, 10)
NewBaseSalary = Cells(irow, 21)
Worksheets("Merit Communication").Select
Range("E7").Value = EmployeeName
Range("E8").Value = EmployeeID
Range("E9").Value = JobTitle
Range("E11").Value = CurrentBaseSalary
Range("E12").Value = IncreasePercent
Range("E13").Value = NewBaseSalary
'Print to PDF
ThisWorkbook.Worksheets("Merit Communication").ExportAsFixedFormat _
Type:=xlTypePDF, _
FileName:="C:\Users\NSampair\Box\Working File\Comp\2023 Merit Process\Merit_Letters\" & Range("S8").Value, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
irow = irow + 1
Loop
End Sub
Sub MeritCommunication()
Dim irow As Integer
Dim EmployeeName As String
Dim EmployeeID As Double
Dim JobTitle As String
Dim CurrentBaseSalary As Double
Dim IncreasePercent As Double
Dim NewBaseSalary As Double
Dim FileName As String
Dim CheckNewBaseSalary As Double
Worksheets("Master Merit").Select
irow = 15
Do Until IsEmpty(Cells(irow, 1))
'Populate Distribution Sheet
Worksheets("Master Merit").Select
EmployeeName = Cells(irow, 2)
EmployeeID = Cells(irow, 1)
JobTitle = Cells(irow, 3)
CurrentBaseSalary = Cells(irow, 5)
IncreasePercent = Cells(irow, 10)
NewBaseSalary = Cells(irow, 21)
Worksheets("Merit Communication").Select
Range("E7").Value = EmployeeName
Range("E8").Value = EmployeeID
Range("E9").Value = JobTitle
Range("E11").Value = CurrentBaseSalary
Range("E12").Value = IncreasePercent
Range("E13").Value = NewBaseSalary
'Print to PDF
ThisWorkbook.Worksheets("Merit Communication").ExportAsFixedFormat _
Type:=xlTypePDF, _
FileName:="C:\Users\NSampair\Box\Working File\Comp\2023 Merit Process\Merit_Letters\" & Range("S8").Value, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
irow = irow + 1
Loop
End Sub