Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default strange "subscript out of range" error!

hi
i have 3 workbooks:

program.xls
cost price phase one.xls
po payment.xls

i sheet1 of program i have a command button and i want when user clic
it some code execute.
but i get "subsript out of range error" and i can't undrestand why!

here is the line og code that vba stop on it during the execution:

Workbooks("cost price phase one").Worksheets(1).Cells(1, 2).Cop
Destination:=Workbooks("program").Sheets("sheet2") .Cells(1, 1)

any idea?
regards
Reza Behnoo

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default strange "subscript out of range" error!

Workbooks("program").WorkSheets("sheet2").Range("A 1") =
Workbooks("cost price phase one").Worksheets(1).Range
("A1") ).Value

Patrick Molloy
Microsoft Excel MVP

Destination:=Workbooks("program").Sheets("sheet2" ).Cells

(1, 1)
-----Original Message-----
hi
i have 3 workbooks:

program.xls
cost price phase one.xls
po payment.xls

i sheet1 of program i have a command button and i want

when user click
it some code execute.
but i get "subsript out of range error" and i can't

undrestand why!

here is the line og code that vba stop on it during the

execution:

Workbooks("cost price phase one").Worksheets(1).Cells(1,

2).Copy
Destination:=Workbooks("program").Sheets("sheet2" ).Cells

(1, 1)

any idea?
regards
Reza Behnood


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default strange "subscript out of range" error!

no differences
by the way i used copy method cause i want cell be copied with all value and forma
i changed my code to what you wrote but again there is subscription out of range error(9

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default strange "subscript out of range" error!

problem solved
i must use file names with extension (program.xls) insteed of (program
thank

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
Error Message "Subscript our of range" gsmclang Excel Discussion (Misc queries) 1 April 5th 07 06:59 PM
Array as a "named range" - formula ok in cells, but error as "named range" tskogstrom Excel Discussion (Misc queries) 11 December 28th 06 04:44 PM
"Subscript of range" error Bhodge Excel Programming 2 February 12th 04 06:58 AM
SaveAs "subscript out of range" error (COM - SOAP) Matthia Excel Programming 0 July 11th 03 07:01 AM
SaveAs "subscript out of range" error (COM - SOAP) jaf Excel Programming 0 July 10th 03 07:59 PM


All times are GMT +1. The time now is 05:17 PM.

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"