Thread: Copying Problem
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JohnI JohnI is offline
external usenet poster
 
Posts: 6
Default Copying Problem

Michael,

Try the following -

Private Sub CommandButton6_Click()
ActiveSheet.Cells.Copy
Sheets("Cashflow Chart Sheet").Select
With ActiveSheet
.Range("A1").PasteSpecial Paste:=xlAll, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
.Cells.Copy
.Range("A1").PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
.Range("A2:I7").Clear
.Range("A29:I29").ClearContents
.Range("D13").ClearContents
.Range("A1").Select
End With
End Sub


regards,

JohnI

"Michael" wrote in message
...


Hi all,

I recorded the macro below which runs fine until I attach
it to commandbutton6 on my spreadsheet

I get the following error message on

Range ("A1"). Select

"Select method of range class failed"

I have included macro below, any ideas? Thanks for your
help !

Michael


Private Sub CommandButton6_Click()
With ActiveSheet
Cells.Select
Selection.Copy
Sheets("Cashflow Chart Sheet").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlAll,
Operation:=xlNone, SkipBlanks:=False _
, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _

False, Transpose:=False
Range("A2:I7").Select
Application.CutCopyMode = False
Selection.Clear
ActiveWindow.SmallScroll Down:=13
Range("A29:I29").Select
Selection.ClearContents
ActiveWindow.LargeScroll Down:=-1
Range("D13").Select
Selection.ClearContents
Range("A1").Select
End With
End Sub