View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Run-time error "1004" Select method of range class failed

Macro CopyCellstoSheet2
sheets("sheet1").Range("A3").Copy Sheets("Sheet2").Range("A5")
Sheets("Sheet1").Range("F3").Copy Sheets("Sheet2").Range("A7")
End Sub

or , Notice the placement of the . before range

with sheets("sheet1")
.Range("A3").Copy Sheets("Sheet2").Range("A5")
.Range("F3").Copy Sheets("Sheet2").Range("A7")
end with


--
Don Guillett
SalesAid Software

"Tallan" wrote in message
...
Hello,

I'm having a little trouble with a command button I've been playing around
with, all I want it to do is copy text onto another sheet to specific
locations using the destination formatting. I came up with this macro:

Macro1 Macro
' Macro recorded 06/03/2007 by
'

'
ActiveWindow.SmallScroll ToRight:=-2
Range("A3").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A5").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Sheets("Sheet1").Select
Range("F3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("A7").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub


which works fine, but when I add this code to a command button object in
the
sheet I get an error. "Run-time error "1004" Select method of range class
failed"

The error is with these commands...

Sheets("Sheet2").Select
Range("A5").Select

Can anyone help me out?