LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default How to Refer to Another Excel Workbook

Dear All,
I have a Universal VBA in Personal.xls. Now If I open
book1.xls. Then the Personal.xls will
be opened too. However , If I want to refer to book2.xls, I need to
write the following hard code in Personal.xls.

test = [book1.xls]sheet1.range("a1")

What I want is that I do not want the book1.xls to be hard code. How
can I code it to let the filename be current workbook. If my workbook
is book2.xls or book3.xls . Then the VBA should
open book2 or book3. How can I write the variables for my current
workbook. Thanks.
 
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
Refer to workbook Arne Hegefors Excel Programming 1 November 15th 07 09:20 AM
How to refer to the specified sheet in the workbook? Jack Excel Programming 1 September 19th 07 11:11 PM
Refer to more than one worksheet in a workbook Göran M Excel Worksheet Functions 0 January 2nd 06 07:02 AM
When writing a macro in excel workbook, how do I refer to ea cell Diana Bartz Excel Programming 1 July 7th 05 09:51 PM
how to I refer to current workbook without using its name? confused Excel Worksheet Functions 2 June 16th 05 11:50 PM


All times are GMT +1. The time now is 09:02 AM.

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"