Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Question on copying a range

Hi all:

I'm trying to find the easiest way to programatically copy a named range
in one workbook (normally unopened) into a corresponding target range in my
open workbook. This is part of a conversion from Lotus 1-2-3 to Excel. In
1-2-3, the command RangeCombine, as part of the Range object in LotusScript,
handled the task of opening the specified worksheet, locating the named
range therein, and then copying that range to the range specified in the
Range Object associated with the RangeCombine command. For example:

lrMyDestinationRange.RangeCombine lcFromFilePathAndName, , , ,
$CombineReplace, "PNAME"

whe
- lrMyDestinationRange is the Range object into which the new values
will be placed,
- lcFromFilePathAndName is a string value holding what its name
implies,
- $CombineReplace is a LotusScript-specific value indicating that
the new data should Replace any existing values,
- "PNAME" is the name of the range in the external worksheet.

Does anyone have any good, quick, easy ideas on how this same type of
thing can be implemented in Excel VBA?

Any and all help will be GREATLY appreciated!

Thanks,

Jon


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Question on copying a range

Ron has several examples of copying at this site. scroll down the menu to
find your topic.

http://www.rondebruin.nl/tips.htm

"JonWestcot" wrote:

Hi all:

I'm trying to find the easiest way to programatically copy a named range
in one workbook (normally unopened) into a corresponding target range in my
open workbook. This is part of a conversion from Lotus 1-2-3 to Excel. In
1-2-3, the command RangeCombine, as part of the Range object in LotusScript,
handled the task of opening the specified worksheet, locating the named
range therein, and then copying that range to the range specified in the
Range Object associated with the RangeCombine command. For example:

lrMyDestinationRange.RangeCombine lcFromFilePathAndName, , , ,
$CombineReplace, "PNAME"

whe
- lrMyDestinationRange is the Range object into which the new values
will be placed,
- lcFromFilePathAndName is a string value holding what its name
implies,
- $CombineReplace is a LotusScript-specific value indicating that
the new data should Replace any existing values,
- "PNAME" is the name of the range in the external worksheet.

Does anyone have any good, quick, easy ideas on how this same type of
thing can be implemented in Excel VBA?

Any and all help will be GREATLY appreciated!

Thanks,

Jon



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Question on copying a range


Does this help?

Workbooks("source").Sheets("Sheet1").Range("nrange ").copy

"source would be the workbook you are looking to get the info from,
nrange would be the name of your named range, this assumes the workbook
is open.


--
The Code Cage Team

Regards,
The Code Cage Team
http://www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30446

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Question on copying a range

Hi:

Thanks for the reply. I'm trying to do this, though, in one workbook
that is open and pulling the information from another workbook that is NOT
open.

I'll keep your sample in mind, though; never know when it will come in
handy.

Thanks again!

Jon

Does this help?

Workbooks("source").Sheets("Sheet1").Range("nrange ").copy

"source would be the workbook you are looking to get the info from,
nrange would be the name of your named range, this assumes the workbook
is open.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Question on copying a range

Hi JLGWhiz:

Thanks for the link. I'll go check it out.

Jon

Ron has several examples of copying at this site. scroll down the menu to
find your topic.

http://www.rondebruin.nl/tips.htm



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
Range copying macro question Andy Excel Discussion (Misc queries) 2 March 26th 08 08:58 PM
Which is faster, copying range to another set of ranges or copying tomemory? axwack Excel Programming 2 December 12th 07 01:19 PM
Copying Range Based On Certain Criteria? Possible looping through the Range Big H Excel Programming 1 October 27th 06 03:32 AM
copying dynamic range based on cell outside of range xcelelder Excel Programming 3 September 29th 05 05:08 PM
Searching a range and copying values into a new range.... **Please help** :( Lancia Excel Programming 1 September 29th 04 01:08 PM


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