I am struggling with VBA logic to build an mail body with undefined numbers of names. The names, which are located in sheet "Names" column "D", should be listed in the email body.
This should take the names and put them in an array, starting from row 2 in column "D".
Dim i As Integer
Dim j As Integer
Dim cellValue() As String
i = 2
j = 2
Do Until IsEmpty(Cells(i,4))
cellValue(i) = Cells(i, 4).Value
i = i + 1
Loop
Located in the mail's body:
"Names : "
Do While j <= i
"Name " & cellValue(j)
j = j + 1
Loop
I am not able to get any names in the email, still I have the other part of the email right.