Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I printing reports from 4 different files who names change each month
depending on the month and version I would like to enter the file name in a cell in the worksheet. Then have the VBA code search and return the path where the file exist -- Helping Is always a good thing |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See:
http://groups.google.com/group/micro...718b529f0a6e60 -- Gary's Student "QuietMan" wrote: I printing reports from 4 different files who names change each month depending on the month and version I would like to enter the file name in a cell in the worksheet. Then have the VBA code search and return the path where the file exist -- Helping Is always a good thing |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Gary,
thsi opens up a dialog box where the person would have to select the file I want the code to search for the path based on the file name inputed in a cell in the worksheet -- Helping Is always a good thing "Gary''s Student" wrote: See: http://groups.google.com/group/micro...718b529f0a6e60 -- Gary's Student "QuietMan" wrote: I printing reports from 4 different files who names change each month depending on the month and version I would like to enter the file name in a cell in the worksheet. Then have the VBA code search and return the path where the file exist -- Helping Is always a good thing |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this:
Sub gsnu() Dim s0 As String Dim s1 As String Dim s2 As String Dim s3 As String Dim s4 As String s0 = "cd\" s1 = "findit.bat" s2 = "dir /s " s3 = Range("A1").Value s4 = "pause" Open s1 For Output As #1 Print #1, s0 Print #1, s2 & s3 Print #1, s4 Close #1 x = Shell("cmd.exe /c findit.bat", 1) End Sub This routine uses the contents of cell A1 to create a .bat file. The routine then executes the .bat file. The .bat file uses the dir command to do the searching. -- Gary''s Student "QuietMan" wrote: Gary, thsi opens up a dialog box where the person would have to select the file I want the code to search for the path based on the file name inputed in a cell in the worksheet -- Helping Is always a good thing "Gary''s Student" wrote: See: http://groups.google.com/group/micro...718b529f0a6e60 -- Gary's Student "QuietMan" wrote: I printing reports from 4 different files who names change each month depending on the month and version I would like to enter the file name in a cell in the worksheet. Then have the VBA code search and return the path where the file exist -- Helping Is always a good thing |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Variabilize File Path or File Name in SumProduct (and Vlookup too) | Excel Worksheet Functions | |||
Formula too long - new file path is shorter than old file path - Excel 2003 | Excel Worksheet Functions | |||
Excel updating from XML file - file path specific? | Excel Discussion (Misc queries) | |||
How set file open path to filepath of file opened with Explorer ? | Excel Programming | |||
get path - save new file - same sub-directory as existing file | Excel Programming |