#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default excel macro



is there a way to have a macro prompt the user to specify
a file to be openedn and then grab data and formulas from
that sheet and bring it into a new project.
thanks
doug
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default excel macro

Doug, the following is one way to prompt a user for a file:

Dim fNameAndPath As Variant
fNameAndPath = Application.GetOpenFilename _
(FileFilter:="Excel Files (*.XLS), *.XLS", _
Title:="Select File To Be Opened")
If fNameAndPath = False Then _
Exit Sub
MsgBox fNameAndPath

To copy data and formulas over depends a lot on your needs. The simpliest
way to start is to use the macro recorder. Please note the result often
requires a lot of modificaitons.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"doug" wrote in message
...


is there a way to have a macro prompt the user to specify
a file to be openedn and then grab data and formulas from
that sheet and bring it into a new project.
thanks
doug



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default excel macro

Doug,

Take a look at GetOpenFileName method in help. This will give a browser
dialog. You then have to open the chosen file, and you will be able tyo
access the Activeworkbook Activesheet to get your data.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"doug" wrote in message
...


is there a way to have a macro prompt the user to specify
a file to be openedn and then grab data and formulas from
that sheet and bring it into a new project.
thanks
doug



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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
excel macro - macro initiation upon hitting the ener key arunjoshi[_2_] Excel Programming 1 April 28th 04 09:58 PM


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