View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] leejen87@gmail.com is offline
external usenet poster
 
Posts: 1
Default Runtime error 1004

PLease help!

This has been racking my brains for days!

I am trying to select a cell from which to start a selection copy.
however i keep getting the runtime error on the Range line

where, o where am i going wrong?!?!?!?



Private Sub CommandButton1_Click()
OrderNumber = InputBox("Enter CPL#")
If OrderNumber = "" Then
End If

Receiptfile = "CPL #" & OrderNumber & ".xls"
Workbooks.Open Filename:="C:\Documents and Settings\a\My Documents\" &
Receiptfile
ActiveSheet.Name = Receiptfile


Workbooks.Open Filename:= _
"C:\Documents and Settings\a\My Documents\Entry Build.xls"
Windows("Entry Build.xls").Activate
Sheets("Entry Build").Select
Sheets("Entry Build").Copy After:=Workbooks(Receiptfile).Sheets(1)


Sheets(Receiptfile).Activate
Range("A12").Activate THIS IS THE CULPRIT LINE OF CODE!!!
Range(Selection, Selection.End(xlToRight)).Select
Range("A12:I350").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Entry Build").Select
ActiveWindow.SmallScroll Down:=-3
Range("A5").Select
ActiveSheet.Paste