[RESOLVED] How to join the contents of two cells into one?
Hello,
I tried:
Code:
Sub combine()
Dim str(1 To 2) As String 'create the matrix
Dim final As String 'create the string
str(1) = ActiveCell.Text 'takes the value
str(2) = ActiveCell.Offset(0, 1).Text 'takes the other
final = Join(str, " ") 'join
ActiveCell.Offset(0, 1).Text = final 'print
End Sub
But it results in error 424
Re: How to join the contents of two cells into one?
But it works with ActiveCell.Offset(0, 1) = final instead of ActiveCell.Offset(0, 1).Text = final
Re: How to join the contents of two cells into one?
the text property of cells is read only
it is used to read the displayed (formatted), content of the cell, assigned by the value property
Re: How to join the contents of two cells into one?
Thanks. Now that I understand the difference among. text,. value,. and formula. FormulaR1C1