Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Subscipt out of Range

Hi

I have the following code which should copy certain ranges
from workbook 'Remittance Procedure Form Template Test'
to 'Remittance Template' but it keeps coming up with the
error Subscript out of Range.

Can anyone help?


Sub Copy_to_Template()

Set outfile = Workbooks("C:\Documents and
Settings\ThoemmE1\Desktop\Remittance Project\Remittance
Template.xls")
Workbooks("Remittance Procedure Form Template
Test").Activate
Worksheets("92212353").Activate
Range("b1").Copy Destination:=outfile.Range("b6")
Range("a1:a5").Copy Destination:=outfile.Range("a16")
Range("c1:c5").Copy Destination:=outfile.Range("b16")
Range("d1:d5").Copy destinationL = outfile.Range("c16")

'outfile.Range("b10").Value = ActiveSheet.Name

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Subscipt out of Range

Jahson,

Remove the path name from the workbook. E.g.,

Set outfile = Workbooks("Remittance Template.xls")

This assumes that the file is already open. If not, use

Set outfile = Workbooks.Open("C:\your path\filename.xls")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Jahson" wrote in message
...
Hi

I have the following code which should copy certain ranges
from workbook 'Remittance Procedure Form Template Test'
to 'Remittance Template' but it keeps coming up with the
error Subscript out of Range.

Can anyone help?


Sub Copy_to_Template()

Set outfile = Workbooks("C:\Documents and
Settings\ThoemmE1\Desktop\Remittance Project\Remittance
Template.xls")
Workbooks("Remittance Procedure Form Template
Test").Activate
Worksheets("92212353").Activate
Range("b1").Copy Destination:=outfile.Range("b6")
Range("a1:a5").Copy Destination:=outfile.Range("a16")
Range("c1:c5").Copy Destination:=outfile.Range("b16")
Range("d1:d5").Copy destinationL = outfile.Range("c16")

'outfile.Range("b10").Value = ActiveSheet.Name

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Subscipt out of Range

Thanks for your help Chip.

It is now kicking out another error saying:
Object doesnt support this method or property:

Sub aaa()

Set outfile = Workbooks.Open("C:\Documents and
Settings\ThoemmE1\Desktop\Remittance Project\Remittance
Template.xls")
Windows("Remittance Procedure Form Template
Test.xls").Activate
Worksheets("92212353").Activate
Range("b1").Copy Destination:=outfile.Range("b6")
Range("a1:a5").Copy Destination:=outfile.Range("a16")
Range("c1:c5").Copy Destination:=outfile.Range("b16")
Range("d1:d5").Copy destinationL = outfile.Range("c16")

'outfile.Range("b10").Value = ActiveSheet.Name

End Sub


-----Original Message-----
Jahson,

Remove the path name from the workbook. E.g.,

Set outfile = Workbooks("Remittance Template.xls")

This assumes that the file is already open. If not, use

Set outfile = Workbooks.Open("C:\your path\filename.xls")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Jahson" wrote in

message
...
Hi

I have the following code which should copy certain

ranges
from workbook 'Remittance Procedure Form Template Test'
to 'Remittance Template' but it keeps coming up with the
error Subscript out of Range.

Can anyone help?


Sub Copy_to_Template()

Set outfile = Workbooks("C:\Documents and
Settings\ThoemmE1\Desktop\Remittance Project\Remittance
Template.xls")
Workbooks("Remittance Procedure Form Template
Test").Activate
Worksheets("92212353").Activate
Range("b1").Copy Destination:=outfile.Range("b6")
Range("a1:a5").Copy Destination:=outfile.Range("a16")
Range("c1:c5").Copy Destination:=outfile.Range("b16")
Range("d1:d5").Copy destinationL = outfile.Range

("c16")

'outfile.Range("b10").Value = ActiveSheet.Name

End Sub



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Subscipt out of Range

What line of code is causing the error?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Jahson" wrote in message
...
Thanks for your help Chip.

It is now kicking out another error saying:
Object doesnt support this method or property:

Sub aaa()

Set outfile = Workbooks.Open("C:\Documents and
Settings\ThoemmE1\Desktop\Remittance Project\Remittance
Template.xls")
Windows("Remittance Procedure Form Template
Test.xls").Activate
Worksheets("92212353").Activate
Range("b1").Copy Destination:=outfile.Range("b6")
Range("a1:a5").Copy Destination:=outfile.Range("a16")
Range("c1:c5").Copy Destination:=outfile.Range("b16")
Range("d1:d5").Copy destinationL = outfile.Range("c16")

'outfile.Range("b10").Value = ActiveSheet.Name

End Sub


-----Original Message-----
Jahson,

Remove the path name from the workbook. E.g.,

Set outfile = Workbooks("Remittance Template.xls")

This assumes that the file is already open. If not, use

Set outfile = Workbooks.Open("C:\your path\filename.xls")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Jahson" wrote in

message
...
Hi

I have the following code which should copy certain

ranges
from workbook 'Remittance Procedure Form Template Test'
to 'Remittance Template' but it keeps coming up with the
error Subscript out of Range.

Can anyone help?


Sub Copy_to_Template()

Set outfile = Workbooks("C:\Documents and
Settings\ThoemmE1\Desktop\Remittance Project\Remittance
Template.xls")
Workbooks("Remittance Procedure Form Template
Test").Activate
Worksheets("92212353").Activate
Range("b1").Copy Destination:=outfile.Range("b6")
Range("a1:a5").Copy Destination:=outfile.Range("a16")
Range("c1:c5").Copy Destination:=outfile.Range("b16")
Range("d1:d5").Copy destinationL = outfile.Range

("c16")

'outfile.Range("b10").Value = ActiveSheet.Name

End Sub



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Subscipt out of Range

Hi

Range("b1").Copy Destination:=outfile.Range("b6")
Range("a1:a5").Copy Destination:=outfile.Range("a16")
Range("c1:c5").Copy Destination:=outfile.Range("b16")
Range("d1:d5").Copy destinationL = outfile.Range("c16")

Cant quite work this one out

Thanks


-----Original Message-----
What line of code is causing the error?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Jahson" wrote in

message
...
Thanks for your help Chip.

It is now kicking out another error saying:
Object doesnt support this method or property:

Sub aaa()

Set outfile = Workbooks.Open("C:\Documents and
Settings\ThoemmE1\Desktop\Remittance Project\Remittance
Template.xls")
Windows("Remittance Procedure Form Template
Test.xls").Activate
Worksheets("92212353").Activate
Range("b1").Copy Destination:=outfile.Range("b6")
Range("a1:a5").Copy Destination:=outfile.Range("a16")
Range("c1:c5").Copy Destination:=outfile.Range("b16")
Range("d1:d5").Copy destinationL = outfile.Range

("c16")

'outfile.Range("b10").Value = ActiveSheet.Name

End Sub


-----Original Message-----
Jahson,

Remove the path name from the workbook. E.g.,

Set outfile = Workbooks("Remittance Template.xls")

This assumes that the file is already open. If not, use

Set outfile = Workbooks.Open("C:\your

path\filename.xls")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Jahson" wrote in

message
...
Hi

I have the following code which should copy certain

ranges
from workbook 'Remittance Procedure Form Template

Test'
to 'Remittance Template' but it keeps coming up with

the
error Subscript out of Range.

Can anyone help?


Sub Copy_to_Template()

Set outfile = Workbooks("C:\Documents and
Settings\ThoemmE1\Desktop\Remittance

Project\Remittance
Template.xls")
Workbooks("Remittance Procedure Form Template
Test").Activate
Worksheets("92212353").Activate
Range("b1").Copy Destination:=outfile.Range("b6")
Range("a1:a5").Copy Destination:=outfile.Range

("a16")
Range("c1:c5").Copy Destination:=outfile.Range

("b16")
Range("d1:d5").Copy destinationL = outfile.Range

("c16")

'outfile.Range("b10").Value = ActiveSheet.Name

End Sub


.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Subscipt out of Range

Jahson,

You need to include the worksheet reference in the destinations.
E.g.,

Range("b1").Copy
Destination:=outfile.Worksheets("Sheet1").Range("b 6")



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Jahson" wrote in message
...
Hi

Range("b1").Copy Destination:=outfile.Range("b6")
Range("a1:a5").Copy Destination:=outfile.Range("a16")
Range("c1:c5").Copy Destination:=outfile.Range("b16")
Range("d1:d5").Copy destinationL = outfile.Range("c16")

Cant quite work this one out

Thanks


-----Original Message-----
What line of code is causing the error?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Jahson" wrote in

message
...
Thanks for your help Chip.

It is now kicking out another error saying:
Object doesnt support this method or property:

Sub aaa()

Set outfile = Workbooks.Open("C:\Documents and
Settings\ThoemmE1\Desktop\Remittance Project\Remittance
Template.xls")
Windows("Remittance Procedure Form Template
Test.xls").Activate
Worksheets("92212353").Activate
Range("b1").Copy Destination:=outfile.Range("b6")
Range("a1:a5").Copy Destination:=outfile.Range("a16")
Range("c1:c5").Copy Destination:=outfile.Range("b16")
Range("d1:d5").Copy destinationL = outfile.Range

("c16")

'outfile.Range("b10").Value = ActiveSheet.Name

End Sub


-----Original Message-----
Jahson,

Remove the path name from the workbook. E.g.,

Set outfile = Workbooks("Remittance Template.xls")

This assumes that the file is already open. If not, use

Set outfile = Workbooks.Open("C:\your

path\filename.xls")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Jahson" wrote in
message
...
Hi

I have the following code which should copy certain
ranges
from workbook 'Remittance Procedure Form Template

Test'
to 'Remittance Template' but it keeps coming up with

the
error Subscript out of Range.

Can anyone help?


Sub Copy_to_Template()

Set outfile = Workbooks("C:\Documents and
Settings\ThoemmE1\Desktop\Remittance

Project\Remittance
Template.xls")
Workbooks("Remittance Procedure Form Template
Test").Activate
Worksheets("92212353").Activate
Range("b1").Copy Destination:=outfile.Range("b6")
Range("a1:a5").Copy Destination:=outfile.Range

("a16")
Range("c1:c5").Copy Destination:=outfile.Range

("b16")
Range("d1:d5").Copy destinationL = outfile.Range
("c16")

'outfile.Range("b10").Value = ActiveSheet.Name

End Sub


.



.



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
How do I enter formula sum(range+range)*0.15 sumif(range=3) tkw Excel Discussion (Misc queries) 2 October 1st 09 09:17 PM
Cond. Format Data Bars of range based on values of another range alexmo Excel Worksheet Functions 4 January 16th 09 04:03 AM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
formula to sort a range so that it matches the exact rows of a column that is outside that range? steveo Excel Discussion (Misc queries) 1 June 18th 06 02:05 AM
how to? set my range= my UDF argument (range vs. value in range) [advanced?] Keith R[_3_] Excel Programming 2 August 11th 03 05:55 PM


All times are GMT +1. The time now is 04:06 AM.

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

About Us

"It's about Microsoft Excel"