Calculating No. of strings returned by a Split function

I have written the following code on a button which extracts a value from a rich text field(“OrderInfo”). The rich text field contain multiple values, so I have to split it with delimiter as a new line character.

Dim order As Variant

Dim orderItem As Variant

orderItem = doc.GetItemValue(“OrderInfo”)

delim = Chr$(10)

order = Split(orderItem(0),delim)

For x = 0 To 8

.cells(x+4,2).value = order(x)

Next

can anyone tell me how can I calculate the no. of string returned by the split function as the values in richtext field varies ?

Any help will be great.

Thank you in advance

Subject: Calculating No. of strings returned by a Split function

I would try the following …

NumberOfElements = Ubound ( arrValues ) - LBound ( arrValues ) + 1

M. Weller

Subject: RE: Calculating No. of strings returned by a Split function

Thank you very much for quick response…