Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Creating XL links in VBA code

The Excel help menu lists this set of instructions, to link a range in one
workbook to a range on a sheet in a different workbook:

Create a link between cells in different workbooks

1. Open both the workbook that will contain the link (called the
destination
workbook), and the workbook that contains the data you want to link to
(called the source workbook).
2. In the destination workbook, click Save .
3. Select a cell or cells you want to link from.
4. If you are creating a new formula, type = (an equal sign).
5. If you are entering the link elsewhere in the formula, type the operator
or function that you want to precede the link.
6. On the Window menu, click the name of the source workbook, and then
click the worksheet that contains the cells you want to link to.
7. Select the cells you want to link to.
8. Complete the formula. When you finish entering the formula, press
ENTER.

I need to automate this process in VBA code, since the size of the range
potentially changes each time it's opened.

A source spreadsheet is output from SAP, and I need to link only certain
columns from it into a new spreadsheet. When the report is run each week, the
number of items in the storage location can change, resulting in a different
number of rows in the spreadsheet each time.
I know how to use the UsedRange property to find out how many rows there
are in the source, but need some help setting up the link to the destination
spreadsheet. Every time I try it, I get the "text" of the formula, not the
value from the other spreadsheet ("=[ZUPG32000273.xls]Sheet1!R2C3:R103C3"
shows up in the cell)

Thanks!
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
need some help with creating links Mona Excel Discussion (Misc queries) 1 October 16th 09 11:51 PM
Creating Links??? brat247 Excel Discussion (Misc queries) 0 March 17th 08 04:17 PM
creating Links sparklydaisy Excel Discussion (Misc queries) 3 November 23rd 05 04:34 PM
Links creating REF!! [email protected] Links and Linking in Excel 1 December 13th 04 04:01 PM
Creating Links A Psychologist in Alberta Excel Worksheet Functions 0 November 5th 04 02:15 AM


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