#1   Report Post  
Anthony
 
Posts: n/a
Default VB error

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

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

That suggests that you do not have a sheet called database. Check the
spelling, and if the sheet has a trailing space.

--
HTH

Bob Phillips

"Anthony" wrote in message
...
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



  #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


  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

I'd guess you don't have a worksheet named database in that active workbook.

Look for extra spaces -- leading or trailing (or transposed characters)

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


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ignore error msgs in formula references gharden Excel Discussion (Misc queries) 4 June 17th 05 12:14 AM
Error trapped only while stepping through the code - Not triggered when run Jeff Excel Discussion (Misc queries) 7 March 7th 05 06:29 PM
Error trapped only while stepping through the code - Not triggered when run Jeff Excel Discussion (Misc queries) 0 February 28th 05 06:26 PM
Problem with VBA returning the contents of a long formula. [email protected] Excel Discussion (Misc queries) 2 February 23rd 05 12:14 AM
ERROR Pinto1uk Excel Discussion (Misc queries) 1 February 8th 05 03:15 AM


All times are GMT +1. The time now is 01:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"