MrExcel Publishing
Your One Stop for Excel Tips & Solutions

I'm going cray with this paste proc - please help, i'm new to this


Posted by Jason on September 15, 2000 2:03 AM

I need to copy a range of cells from one worksheet and then paste.special them into another.
I keep getting a debug error when the destination cells are selected. I've marked the erroneous code with **
Here is the code -

Private Sub CommandButton2_Click()
Range("I7:I156").Select
Selection.Copy
Sheets("Store").Select
** Range("D7").Select**
Selection.PasteSpecial Paste:=xlValues, Operation:=xlSubtract, SkipBlanks _
:=False, Transpose:=False
Sheets("MLT").Select
Range("A7").Select
Application.CutCopyMode = False

Any help would be greatly appreciated.
Thanks in advance.


Posted by Ivan Moala on September 15, 0100 2:16 AM

Try

Private Sub CommandButton2_Click()
Range("I7:I156").Select
Selection.Copy
Sheets("Store").Select
ActiveSheet.Range("D7").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlSubtract, SkipBlanks _
:=False, Transpose:=False
Sheets("MLT").Select
ActiveSheet.Range("A7").Select
Application.CutCopyMode = False


End Sub


Ivan


Posted by Jason on September 15, 0100 2:26 AM

Thank you so much Ivan