PC Review


Reply
Thread Tools Rate Thread

Coping Range from another Excel file

 
 
rameshs319@gmail.com
Guest
Posts: n/a
 
      16th Jan 2008
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 With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      16th Jan 2008
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")
"(E-Mail Removed)" 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Coping Format Control input range to other picklists - HELP!! Tibby Microsoft Excel Misc 0 28th Oct 2008 04:04 PM
How to protect coping of excel file? Harshad Microsoft Excel Misc 3 26th Sep 2008 04:24 PM
coping file from a remote file share - FILE IS NO LONG THERE bogus error message Heith Windows Vista Networking 0 18th Oct 2007 09:58 PM
copy the range names while coping cells =?Utf-8?B?TWlyaQ==?= Microsoft Excel Programming 1 30th May 2007 03:00 PM
Need help coping a range of data from sheet 1 to the next empty cell in sheet2 alpine7411@hotmail.com Microsoft Excel Programming 3 27th Apr 2006 09:31 PM


Features
 

Advertising
 

Newsgroups
 


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