View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
MSHO MSHO is offline
external usenet poster
 
Posts: 15
Default Pulling files in using Macros

This is what I have so far... and it's not working... any clue?

Sub Macro2()

Dim filetypenm
filetypenm = InputBox("Enter File Name you would like to compare")

Dim nm
nm = InputBox("Enter Year you would like to compare")
Dim sStr1
sStr1 = "C:\Desktop\Coop Students\Small Package Rates\UPS Rates\" & nm \ " &
filetypenm"

Dim nm1
nm1 = InputBox("Enter Year you would like to compare it to")
Dim sStr2
sStr2 = "C:\Desktop\Coop Students\Small Package Rates\UPS Rates\" & nm1 \ "
& filetypenm"


End Sub

"tony h" wrote:


There are a whole bundle of different ways to do what you want so it is
really down to what you want to achieve. If you can clarify that then
we can help a bit further

Meanwhile; I presume that what you are trying to do is to ask which
year to open and then open just that file.

If the folders are arranged in a tidy form eg ...\2005\wkb.xls and
...\2006\wkb.xls then what I would do is not to search for the file but
to ask for the year. Then you can form the folder name using the reply
and open the wkb as normal.

If you really need a selection list then I suggest using a form with a
listbox populated with file and folder names (use the filesystem object
to compile the list) Then using a selection on the form open the file or
files as appropriate.

A


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=500135