Using helper cells (“B117:B120”), the code I have below does display the MsgBox in the format that I want.
However, is there any way to do this without hard coding the individual cells but use a Named Range for the helper cells instead?
If there is, nothing I’ve tried works
My code is this,
Nearest thing I came up with as a way of compromise was:
However, is there any way to do this without hard coding the individual cells but use a Named Range for the helper cells instead?
If there is, nothing I’ve tried works
My code is this,
VBA Code:
Sub MsgBoxMissingNames()
MsgBox "Missing names are:-" _
& vbCrLf & " " & Range("B117").Value _
& vbCrLf & " " & Range("B118").Value _
& vbCrLf & " " & Range("B119").Value _
& vbCrLf & " " & Range("B120").Value, vbOKOnly
Range("MissingNames").Select ‘This is the helper cells Named Range
End Sub
VBA Code:
>>
Dim r As Range, ary
Set r = Sheets("Sheet1").Range("MissingNames")
With Application
MsgBox " Missing names are:-" & vbCrLf & _
Join(.Transpose(r), " & ")
>>