Converting entered date list to Status

Usually, if we want to convert entered date in the row list to become remark of status we use "IF" formula, like example below.







But actually we can use function in VBA to convert it. Just insert a module in the VBA project and copy paste herebelow
function .


Public Function StatusRem(dated As Range)

For i = dated.Columns.Count To 1 Step -1

If dated.Cells(1, i).Value <> "" Then

StatusRem = Cells(1, dated.Column + i - 1).Value

Exit Function

End If

Next i

StatusRem = ""

End Function




Now we can use that function as formula as example below :



This formula will return a text value of column header no matter how may column are in the list.

No comments: