After executing a VBA Cell Assignment, the cell is empty. In the code below, all cell assignments (such as .Cells(outRow, 10).Value = providerLast
) do not update the value of the cell.
The variable values being transferred to each cell have confirmed values and are not empty.
Dim providerLast As String
Dim providerFirst As String
Dim providerEmail As String
Dim staffString As String
Dim staffList() As String
Dim staffEmail As String
With Workbooks("1-May-2024 MASTERS LEVEL SUPERVISOR_SUPERVISEE SPREADSHEET.xlsm").Worksheets("Current")
outRow = 2
currentRow = 2
While Not (IsEmpty(.Cells(currentRow, 1).Value) And IsEmpty(.Cells(currentRow, 2).Value))
' Get the current provider.
providerLast = .Cells(currentRow, 1).Value
providerFirst = .Cells(currentRow, 2).Value
providerEmail = LookupEmail(RTrim(providerFirst) & " " & RTrim(providerLast))
staffString = .Cells(currentRow, 5).Value
If Len(RTrim(staffString)) > 0 Then
staffList = Split(staffString, ",")
For i = LBound(staffList, 1) To UBound(staffList, 1)
staffEmail = LookupEmail(staffList(i))
.Cells(outRow, 10).Value = providerLast
.Cells(outRow, 11).Value = providerFirst
.Cells(outRow, 12).Value = staffList(i)
.Cells(outRow, 13).Value = providerEmail
.Cells(outRow, 14).Value = staffEmail