Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default External Cell Referencing in VBA?


Hi everyone! This is my first post on this board :)

I just want to know how I can do the following in VBA:

=[Book1998.xls]Sheet1!$F$1


Thanks!

Matt

--
mattsva
-----------------------------------------------------------------------
mattsvai's Profile: http://www.excelforum.com/member.php...fo&userid=3113
View this thread: http://www.excelforum.com/showthread.php?threadid=50798

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default External Cell Referencing in VBA?

Workbooks("Book 1998.xls").Worksheets("Sheet1").Range("F1")

the range has many properties such as .Value, .Formula, etc. which can tag
ob the end.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"mattsvai" wrote in
message ...

Hi everyone! This is my first post on this board :)

I just want to know how I can do the following in VBA:

=[Book1998.xls]Sheet1!$F$1


Thanks!

Matts


--
mattsvai
------------------------------------------------------------------------
mattsvai's Profile:

http://www.excelforum.com/member.php...o&userid=31134
View this thread: http://www.excelforum.com/showthread...hreadid=507987



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default External Cell Referencing in VBA?


Thanks for the reply Bob,

That is exactly the first thing that came to mind.... but I could never
get it to work so I assumed I was way off. This is what I have been
doing:

----
Sub import()
Dim var As String

var = Workbooks("master.xls").Worksheets("Sheet1").Range ("A2")
MsgBox var

End Sub

-------

Yet I always get an "Out of Range" error

Any ideas would be appreciated :)

Thanks again,

Matts


--
mattsvai
------------------------------------------------------------------------
mattsvai's Profile: http://www.excelforum.com/member.php...o&userid=31134
View this thread: http://www.excelforum.com/showthread...hreadid=507987

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default External Cell Referencing in VBA?


Thanks for the reply Bob,

That is exactly the first thing that came to mind.... but I could never
get it to work so I assumed I was way off. This is what I have been
doing:

----
Sub import()
Dim var As String

var = Workbooks("master.xls").Worksheets("Sheet1").Range ("A2")
MsgBox var

End Sub

-------

Yet I always get an "Out of Range" error

Any ideas would be appreciated :)

Thanks again,

Matts


--
mattsvai
------------------------------------------------------------------------
mattsvai's Profile: http://www.excelforum.com/member.php...o&userid=31134
View this thread: http://www.excelforum.com/showthread...hreadid=507987

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default External Cell Referencing in VBA?


Thanks for the reply Bob,

That is exactly the first thing that came to mind.... but I could never
get it to work so I assumed I was way off. This is what I have been
doing:

----
Sub import()
Dim var As String

var = Workbooks("master.xls").Worksheets("Sheet1").Range ("A2")
MsgBox var

End Sub

-------

Yet I always get an "Out of Range" error

Any ideas would be appreciated :)

Thanks again,

Matts


--
mattsvai
------------------------------------------------------------------------
mattsvai's Profile: http://www.excelforum.com/member.php...o&userid=31134
View this thread: http://www.excelforum.com/showthread...hreadid=507987



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default External Cell Referencing in VBA?

Is the workbook you're trying to reference open ?

Things are a bit different if not....

Tim

"mattsvai" wrote in
message ...

Thanks for the reply Bob,

That is exactly the first thing that came to mind.... but I could never
get it to work so I assumed I was way off. This is what I have been
doing:

----
Sub import()
Dim var As String

var = Workbooks("master.xls").Worksheets("Sheet1").Range ("A2")
MsgBox var

End Sub

-------

Yet I always get an "Out of Range" error

Any ideas would be appreciated :)

Thanks again,

Matts


--
mattsvai
------------------------------------------------------------------------
mattsvai's Profile:
http://www.excelforum.com/member.php...o&userid=31134
View this thread: http://www.excelforum.com/showthread...hreadid=507987



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default External Cell Referencing in VBA?


It is meant to be closed... I want to access a cell in an excel fil
that is closed :

--
mattsva
-----------------------------------------------------------------------
mattsvai's Profile: http://www.excelforum.com/member.php...fo&userid=3113
View this thread: http://www.excelforum.com/showthread.php?threadid=50798

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default External Cell Referencing in VBA?

When faced with that need, I generally test that the workbook is not open, then
open the book as read only, do my stuff, then close the book again if it wasn't
open to start with.

Bill
--------------------
mattsvai wrote:
It is meant to be closed... I want to access a cell in an excel file
that is closed :)


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
Referencing External Data Smiley[_2_] Excel Discussion (Misc queries) 1 August 18th 08 07:21 PM
Indirect referencing of external spreadsheets GSM Excel Discussion (Misc queries) 4 February 16th 08 01:59 PM
External links referencing URL with parameter Dmitry Bogdanov Excel Discussion (Misc queries) 0 April 5th 06 01:40 PM
referencing external workbook using variables keepitcool Excel Programming 0 September 29th 03 06:26 PM
Countif failing when referencing an external file Alex Excel Programming 1 September 17th 03 05:12 PM


All times are GMT +1. The time now is 07:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"