Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default how do i set up opening a file from a cell in excel spreadsheet

I am trying to set up a worksheet, I want to be able to put in a file name in
a cell and then have a macro look at that and open the file
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default how do i set up opening a file from a cell in excel spreadsheet

Type in the full path and file name in cell A1 and run the macro. eg:
C:\test.xls

Sub Macro()
Workbooks.Open CStr(Range("a1"))
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Scott" wrote:

I am trying to set up a worksheet, I want to be able to put in a file name in
a cell and then have a macro look at that and open the file

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default how do i set up opening a file from a cell in excel spreadshee

If it is not the active worksheet; you can mention the sheet name as well as
below

Sub Macro()
Workbooks.Open Cstr(Activeworkbook.Sheets("Sheet3").Range("a1"))
End Sub

If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()

--
If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Type in the full path and file name in cell A1 and run the macro. eg:
C:\test.xls

Sub Macro()
Workbooks.Open CStr(Range("a1"))
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Scott" wrote:

I am trying to set up a worksheet, I want to be able to put in a file name in
a cell and then have a macro look at that and open the file

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
opening a file in Excel starts application but dose not open file Bob Shelton Excel Discussion (Misc queries) 1 July 2nd 08 07:51 PM
Opening file in Excel 2003 opens multipule instances of same file Ed_B Excel Discussion (Misc queries) 1 June 21st 07 07:10 PM
Need to insert file modified date of Excel spreadsheet in a cell dj in Mass. Excel Discussion (Misc queries) 0 March 23rd 06 09:41 PM
opening an excel file opens a duplicate file of the same file skm Excel Discussion (Misc queries) 1 December 7th 05 05:52 PM
"Unable to read file" error message when opening a Excel file that contains a PivotTable report. Tim Marsden Charts and Charting in Excel 2 October 15th 05 02:10 PM


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