Thread: VB error
View Single Post
  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

Anthony

First of all, do you have a sheet named database?

If not, you would get the "subscript out of range" error.

Secondly, it is rarely necessary to select anything.

Sub copy_to_other_sheet()
Sheets("Sheet2").Range("G9:G15").Copy _
Destination:=Sheets("database").Range("A1")
'or use Activesheet.Range("G9:G15").Copy _
' Destination:=Sheets("database").Range("A1")
End Sub


Gord Dibben Excel MVP

On Sat, 8 Oct 2005 14:16:02 -0700, "Anthony"
wrote:

I am trying to write some simple code to cope/paste some cells into another
workbook, here is what I have so far..

Sub copy_new_entry_data()
Application.ScreenUpdating = False
Range("G9:G15").copy
Sheets("database").Select

End Sub

when I try and run this I get an error
"Sunscript out of range"

what does that meen ????

thanks