Hi,
I have looped through certain range of cells to put value in an array. Now I want to put these values inside a Textbox with multiple lines or in a Label Caption.
I searched like crazy on Google but I find nothing.
Can anyone help please I need to finish a project and I am stuck because of this.
Thanks for your help J
I have looped through certain range of cells to put value in an array. Now I want to put these values inside a Textbox with multiple lines or in a Label Caption.
I searched like crazy on Google but I find nothing.
Can anyone help please I need to finish a project and I am stuck because of this.
Code:
Dim arr() As Variant, i As Integer, LastRow, Rng As Range
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Set Rng = Worksheets("test").Range("A2:A" & LastRow)
i = 0
ReDim arr(0)
For Each cell In Rng
If Range("C" & cell.Row) = "xyz" Then
arr(i) = cell & "-" & Range("B" & cell.Row) & vbCrLf
i = i + 1
End If
ReDim Preserve arr(i)
Next
‘Getting error here:
TextBox1.Text = arr
Thanks for your help J