ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Paste literal text (https://www.excelbanter.com/excel-programming/307885-paste-literal-text.html)

jc

Paste literal text
 
Is there a way to programatically paste literal text into
a cell. Example: I want create a macro to paste the
literal word 'Text' into a cell at the end of a column.
It seems simple but everything I read describes pasting
from the clipboard.

Thanks in advance
JC

Stephen Rasey[_2_]

Paste literal text
 
Paste from where?

Do you want to enter data into a cell?
Range("A1").Text = "MyContents"
or
Range("A1").Value = "MyContents"

If you are trying to turn a number into text then try:
Range(destination).Text = CStr(Range(source).value)
or
Range(destination).formula = "'" & CStr(range(source).value)

I am not sure of this last:
Range(destination).value = Range(Source).text

Stephen Rasey
Houston
http://wiserways.com
http://excelsig.org



"JC" wrote in message
...
Is there a way to programatically paste literal text into
a cell. Example: I want create a macro to paste the
literal word 'Text' into a cell at the end of a column.
It seems simple but everything I read describes pasting
from the clipboard.

Thanks in advance
JC




Tom Ogilvy

Paste literal text
 
Dim rng as Range
set rng = Cells(rows.count,1).End(xlup)(2)
rng.Value = "Text"

you don't paste, just set the value.

--
Regards,
Tom Ogilvy


"JC" wrote in message
...
Is there a way to programatically paste literal text into
a cell. Example: I want create a macro to paste the
literal word 'Text' into a cell at the end of a column.
It seems simple but everything I read describes pasting
from the clipboard.

Thanks in advance
JC




No Name

Paste literal text
 

-----Original Message-----
Is there a way to programatically paste literal text

into
a cell. Example: I want create a macro to paste the
literal word 'Text' into a cell at the end of a column.
It seems simple but everything I read describes pasting
from the clipboard.

Thanks in advance
JC
.


Thanks guys that's exactly what I needed.


All times are GMT +1. The time now is 05:10 PM.

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