How to Copy & Paste selected Range in Excel (MFC)

  • Thread starter Thread starter Daniel Xu
  • Start date Start date
D

Daniel Xu

Hi, all,

I have not found any solution about how to use Copy & Paste function of
_Worksheet in Excel program sample. Dose anyone could help me, I would be a
happy guy. Thanks!
 
HI,you can try this:
Range("a1").Copy Destination:=Range("b1")
Application.CutCopyMode = False

or range("a1").copy
range("b1").paste
 
Daniel said:
Hi, all,

I have not found any solution about how to use Copy & Paste function of
_Worksheet in Excel program sample. Dose anyone could help me, I would be a
happy guy. Thanks!
You can make your own samples by using "Tools | Macros | Record Macro"

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 21/11/2003 by Steve Garman
'

'
Range("C2:D4").Select
Selection.Copy
Range("E10").Select
ActiveSheet.Paste
End Sub
 
HI, I mean use VC6.0 (MFC), not VB, how to translate?

Range("C2:D4").Select
Selection.Copy
Range("E10").Select
ActiveSheet.Paste

I can see these code in Excel Macro. but I never found any
help document or API explain in the website. Do you have
any information? Thanks!
 
And how to use Range::PasteSpecial(...), MSDN dose not
have any information about this, where can I find some doc?
 
I know how to do about it, it's simple, :-)

COleVariant varRange2;
varRange2.vt = VT_DISPATCH;
V_DISPATCH(&varRange2) = (LPDISPATCH)range2;
V_DISPATCH(&varRange2)->AddRef();
range1.Copy(varRange2);

Thanks at all!
 
I know how to do about it, it's simple, :-)

COleVariant varRange2;
varRange2.vt = VT_DISPATCH;
V_DISPATCH(&varRange2) = (LPDISPATCH)range2;
V_DISPATCH(&varRange2)->AddRef();
range1.Copy(varRange2);

Thanks at all!
 
Back
Top