Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Coping Range from another Excel file

Hi...

I am developing a application in Excel 2003 with userforms, that
requires a Range to be copied from external other excel file to a
specified sheet on the coding file. i tried using Inputbox(type 8) and
also ref edit function. Both links only sheets of the file and they
never point to the external file.
Any suggestions...?

Thanks
S.Ramesh
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Coping Range from another Excel file

By external file, I assume you mean a different workbook. To access data in
a different workbook than the one your code is running in, you must specify
that workbook in the calling code.

ActiveWorkbook.Sheets(1).Range("A1") = _
Workbooks("myWB2").Sheets(1).Range("B1")

So when you try to use a variable to capture the data from another workbook,
the variable must contain the workbook reference also.

Set myVar = Workbooks("myWB2").Sheets(1)
ActiveWorkbook.Sheets(1).Cells(1, 1) = myVar.Range("B1")
" wrote:

Hi...

I am developing a application in Excel 2003 with userforms, that
requires a Range to be copied from external other excel file to a
specified sheet on the coding file. i tried using Inputbox(type 8) and
also ref edit function. Both links only sheets of the file and they
never point to the external file.
Any suggestions...?

Thanks
S.Ramesh

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
Coping Format Control input range to other picklists - HELP!! Tibby Excel Discussion (Misc queries) 0 October 28th 08 04:04 PM
How to protect coping of excel file? Harshad[_2_] Excel Discussion (Misc queries) 3 September 26th 08 04:24 PM
copy the range names while coping cells Miri Excel Programming 1 May 30th 07 03:00 PM
Coping data from excel to word Oggy Excel Programming 1 April 15th 07 12:10 AM
Need help coping a range of data from sheet 1 to the next empty cell in sheet2 [email protected] Excel Programming 3 April 27th 06 09:31 PM


All times are GMT +1. The time now is 07:12 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"