Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Ignore error msgs in formula references | Excel Discussion (Misc queries) | |||
Error trapped only while stepping through the code - Not triggered when run | Excel Discussion (Misc queries) | |||
Error trapped only while stepping through the code - Not triggered when run | Excel Discussion (Misc queries) | |||
Problem with VBA returning the contents of a long formula. | Excel Discussion (Misc queries) | |||
ERROR | Excel Discussion (Misc queries) |