Paste literal text

J

JC

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
 
S

Stephen Rasey

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
 
T

Tom Ogilvy

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

you don't paste, just set the value.
 
G

Guest

-----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.
 
Top