Pasting in Excel

RichS
01-22-2002, 12:54 PM
Hi All,

I very often use the macros in Word and Excel to write code for me in VB.

I'm having a problem with cutting a range of cells and pasting to another area, though, because Excel won't write a line of code for the paste.

I searched this site for info on pasting in Excel, and discovered the "PasteSpecial" method, but I think I'm still messed up on the syntax.

Any hints?

Thanks,

Rich

bpatterson9671
01-22-2002, 01:01 PM
This might help. I use this to copy a range and transpose to another sheet.

Range("I1:I7").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MySheet.xls").Activate
Range("G10").Select 'LSF S.D.
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True

RichS
01-22-2002, 01:26 PM
Hey BPatterson!!

Thank you so very much. Just what I needed.

Richie

RichS
01-22-2002, 02:03 PM
Actually, I am still a little stuck...

That code works for copying the range information to another range, but I'd like to CUT the first range's info and place it in the second range.

I can't seem to figure this one out... I've tried all of the constants in the PasteSpecial argument area, but to no avail...


Any hints?

Thanks

Rich

bpatterson9671
01-22-2002, 02:09 PM
ok - the Selection.cut should work.

Best of luck


Range("E9:E13").Select
Selection.Cut
Range("G9").Select
ActiveSheet.Paste

Mill
01-22-2002, 02:10 PM
Have you looked up the Cut method in the VBA Help? Basically, it's:

Worksheets("Sheet1").Range("A1:G37").Cut

but there's an optional argument that you can use to actually MOVE the range. Look it up in VBA Help.

RichS
01-22-2002, 03:17 PM
Thanks guys...

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum