Here is the macro that concatenates the cells contents in one string.
I've manage to display the result in MsgBox. Now I would like to be
able to use it as a quot;PASTEquot; command. Do you have any ideas?
Sub Macro1()
Result = quot;quot;
For Each cell In Selection
Result = Result amp; quot; quot; amp; cell.Text
Next
MsgBox Result
End Sub
Tnkx in advance, tpHow about just plopping that value into the cell you want.
Sub Macro1()
Dim Result as String
dim Cell as Range
Result = quot;quot;
For Each cell In Selection
Result = Result amp; quot; quot; amp; cell.Text
Next cell
'MsgBox Result
Activesheet.range(quot;a1quot;).value = Result
End Sub
(I like to declare my variables.)
topola wrote:
gt;
gt; Here is the macro that concatenates the cells contents in one string.
gt; I've manage to display the result in MsgBox. Now I would like to be
gt; able to use it as a quot;PASTEquot; command. Do you have any ideas?
gt;
gt; Sub Macro1()
gt; Result = quot;quot;
gt; For Each cell In Selection
gt; Result = Result amp; quot; quot; amp; cell.Text
gt; Next
gt; MsgBox Result
gt; End Sub
gt;
gt; Tnkx in advance, tp
--
Dave Peterson
- Aug 07 Thu 2008 20:45
selection.copy
close
全站熱搜
留言列表
發表留言
留言列表

