ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pasting help (https://www.excelbanter.com/excel-programming/346110-pasting-help.html)

Ambrosia[_6_]

Pasting help
 

Hello

I have a problem with pasting values in a single cell only.

Say I have :

Metro
Home
Centre
451-3434

as a copied value, and I'd like to directly have this pasted in a
single cell including its line spacing.

The macro recording function uses
ActiveSheet.Paste
but it paste values to many cells in a column.

manipulating ActiveCell.FormulaR1C1 ="pasted values here"

seems to be the answer.

What's the script to be able to click on one cell and just activate a
macro that would put in pasted values in a single cell? Thanks


--
Ambrosia
------------------------------------------------------------------------
Ambrosia's Profile: http://www.excelforum.com/member.php...o&userid=28146
View this thread: http://www.excelforum.com/showthread...hreadid=486692


Don Guillett[_4_]

Pasting help
 
how about

range("destinationcell").value=range("sourcell")
or
range("destinationrange").value=range("sourrange") .value
or

--
Don Guillett
SalesAid Software

"Ambrosia" wrote in
message ...

Hello

I have a problem with pasting values in a single cell only.

Say I have :

Metro
Home
Centre
451-3434

as a copied value, and I'd like to directly have this pasted in a
single cell including its line spacing.

The macro recording function uses
ActiveSheet.Paste
but it paste values to many cells in a column.

manipulating ActiveCell.FormulaR1C1 ="pasted values here"

seems to be the answer.

What's the script to be able to click on one cell and just activate a
macro that would put in pasted values in a single cell? Thanks


--
Ambrosia
------------------------------------------------------------------------
Ambrosia's Profile:
http://www.excelforum.com/member.php...o&userid=28146
View this thread: http://www.excelforum.com/showthread...hreadid=486692




Ambrosia[_7_]

Pasting help
 

Um.... I'm afraid I dont know how to use your answer to my question. Can
you explain to me?


--
Ambrosia
------------------------------------------------------------------------
Ambrosia's Profile: http://www.excelforum.com/member.php...o&userid=28146
View this thread: http://www.excelforum.com/showthread...hreadid=486692


Don Guillett[_4_]

Pasting help
 
try it by replacing with your ranges

--
Don Guillett
SalesAid Software

"Ambrosia" wrote in
message ...

Um.... I'm afraid I dont know how to use your answer to my question. Can
you explain to me?


--
Ambrosia
------------------------------------------------------------------------
Ambrosia's Profile:
http://www.excelforum.com/member.php...o&userid=28146
View this thread: http://www.excelforum.com/showthread...hreadid=486692




Tim Williams

Pasting help
 
Are you copying the pasted value from another cell in Excel, or is it
coming from another application?

Tim

"Ambrosia"
wrote in message
...

Um.... I'm afraid I dont know how to use your answer to my question.
Can
you explain to me?


--
Ambrosia
------------------------------------------------------------------------
Ambrosia's Profile:
http://www.excelforum.com/member.php...o&userid=28146
View this thread:
http://www.excelforum.com/showthread...hreadid=486692




Ambrosia[_8_]

Pasting help
 

Say it came from another application....

Thanks a lot for the help, but can you tell me how the script should be
as a macro?

Say I have a copied values already and all i need to do is activate
that macro to paste the values in one cell. Thanks..!


--
Ambrosia
------------------------------------------------------------------------
Ambrosia's Profile: http://www.excelforum.com/member.php...o&userid=28146
View this thread: http://www.excelforum.com/showthread...hreadid=486692


Rowan Drummond[_3_]

Pasting help
 
You could try something like:

Dim clipb As New DataObject
clipb.GetFromClipboard
ActiveCell.Value = clipb.GetText

You will need to set a reference to the Microsoft Forms 2.0 Object
library to be able to use this. In the VBE select ToolsReferences and
check the box next to Microsoft Forms 2.0 Object Library.

Hope this helps
Rowan

Ambrosia wrote:
Say it came from another application....

Thanks a lot for the help, but can you tell me how the script should be
as a macro?

Say I have a copied values already and all i need to do is activate
that macro to paste the values in one cell. Thanks..!




All times are GMT +1. The time now is 10:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com