Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default selection.copy - how to emulate Paste command?

Hi, this macro concatenates cell contents and displays them in Msgbox
and Debug window.
Now I would like to simply use the result string as a PASTE command.

Do you have any ideas?

Sub Concaten_Cells()
Text = ""
i = 0
ile = Selection.Cells.Count
For Each cell In Selection
i = i + 1
If Text < "" Then
Text = Text & ", " & cell.Text
Else
Text = cell.Text
End If
If i = ile Then
Text = Text & "."
End If
Next
MsgBox Text
Debug.Print Text
End Sub

Thanks, Tomek

  #2   Report Post  
Posted to microsoft.public.excel.programming
N10 N10 is offline
external usenet poster
 
Posts: 141
Default selection.copy - how to emulate Paste command?

I think you will have to write the variable "TEXT" to a cell first.

After that you can copy and paste the cell value value or simply continue to
write "TEXT" to where it is required.

N10

wrote in message
oups.com...
Hi, this macro concatenates cell contents and displays them in Msgbox
and Debug window.
Now I would like to simply use the result string as a PASTE command.

Do you have any ideas?

Sub Concaten_Cells()
Text = ""
i = 0
ile = Selection.Cells.Count
For Each cell In Selection
i = i + 1
If Text < "" Then
Text = Text & ", " & cell.Text
Else
Text = cell.Text
End If
If i = ile Then
Text = Text & "."
End If
Next
MsgBox Text
Debug.Print Text
End Sub

Thanks, Tomek



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default selection.copy - how to emulate Paste command?

Hi tpo

What do you meen with PASTE COMAND??

Regards
yngve

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
selection.copy - how emulate Paste command? topola Excel Discussion (Misc queries) 1 January 7th 06 03:43 PM
copy and paste multiple selection Gareth[_3_] Excel Programming 7 May 29th 05 12:23 AM
I want to combine a "match" command with a copy and paste command. alomega Excel Programming 1 February 9th 05 05:52 PM
copy & paste command button RENEE RINEHART Excel Programming 4 April 9th 04 06:10 AM
Copy&Paste and Selection Change Bura Tino Excel Programming 3 November 22nd 03 01:35 AM


All times are GMT +1. The time now is 12:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"