selection.copy - how emulate Paste command?

  • Thread starter Thread starter topola
  • Start date Start date
T

topola

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 "PASTE" command. Do you have any ideas?

Sub Macro1()
Result = ""
For Each cell In Selection
Result = Result & " " & cell.Text
Next
MsgBox Result
End Sub

Tnkx in advance, tp
 
How about just plopping that value into the cell you want.

Sub Macro1()
Dim Result as String
dim Cell as Range

Result = ""
For Each cell In Selection
Result = Result & " " & cell.Text
Next cell

'MsgBox Result

Activesheet.range("a1").value = Result

End Sub

(I like to declare my variables.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top