Discussion:
How to copy this to another cell exactly?
(too old to reply)
cyberdude
2008-01-28 14:27:24 UTC
Permalink
Hi,

Suppose I enter this in a cell:

="His name is "&A3

Then, it may appear as:

His name is John

if I put John in cell A3.

So how can I copy the content:

="His name is "&A3

exactly without copying its value:

His name is John

to another cell using excel VBA?

Thank you

Dave
Leigh Douglass
2008-01-28 14:36:01 UTC
Permalink
copy the cell and then paste special, formula.
Post by cyberdude
Hi,
="His name is "&A3
His name is John
if I put John in cell A3.
="His name is "&A3
His name is John
to another cell using excel VBA?
Thank you
Dave
Rick Rothstein (MVP - VB)
2008-01-28 14:40:18 UTC
Permalink
Click in the cell, but copy the text from the formula bar (select it, then
key in Ctrl+C), click in the cell you want to copy it to and paste it there
(key in Ctrl+V).

Rick
Post by cyberdude
Hi,
="His name is "&A3
His name is John
if I put John in cell A3.
="His name is "&A3
His name is John
to another cell using excel VBA?
Thank you
Dave
Rick Rothstein (MVP - VB)
2008-01-28 14:55:34 UTC
Permalink
I misread your question (you wanted a VBA solution); but, in re-reading it,
I'm not entirely sure what you want to appear in your new cell. If you want
just the formula's text, but for it not to be an active formula in the new
location, then this may do what you want. I'm assuming your formula is in A1
and you want to put it in C7...

ActiveSheet.Range("C7).Value = "'" & ActiveSheet.Range("A1").Formula

Rick
Post by Rick Rothstein (MVP - VB)
Click in the cell, but copy the text from the formula bar (select it, then
key in Ctrl+C), click in the cell you want to copy it to and paste it
there (key in Ctrl+V).
Rick
Post by cyberdude
Hi,
="His name is "&A3
His name is John
if I put John in cell A3.
="His name is "&A3
His name is John
to another cell using excel VBA?
Thank you
Dave
Loading...