Selection.Copy

bgcogen

Registered User.
Local time
Today, 19:05
Joined
Apr 19, 2002
Messages
61
Hi!
This is really a VB question in Excel, but I hope someone can still help me???

Basically I have some code that copies the contents of cell E1 in Sheet B, and then pastes that numerical value to cell B1 in Sheet A.

The trouble is that I'm copying a cell that is a sum of other cells i.e Cell E1 in Sheet B is =Sum(A1:A4).

So I get errors when I try to copy that value. The computer can't seem to copy a value that is derived from a formlae???

What can I do???

Thanks a mill,
D
 
Try using the Paste Special option of pasting values not the actual formula

For example your code should include something like:

Code:
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False

Hope this points you in the right direction.

Graham
 
Can't select

Hi,
Well, the problem really isn't in the pasting, it's in the selecting!!

Even when I try to just select the cell I get an error.


P.s. - I had previously done that paste special in my code, but I can't even copy the data in order to paste!!!

Thanks again for any help????
D
 
Can you post the code...

Maybe someone can help with this
 
Try Activate instead of select

Try using "Activate" instead of "Select".
Activate and Select are almost interchangable, but not quite. As a result, in some instances only one or the other will work. I forget the exact reason why.
 

Users who are viewing this thread

Back
Top Bottom