Interactive commands: WorkFile = Dir(ThisWorkbook.Path & "\*.*")??

S

Snoopy

Hey guys
I am working on a dream ...eh .. a template really :)

I have this macro rolling through a folder to list all filenames into
a worksheet as celle-values.
The folder-path is valued in cell A1.
How will I get my macro bring the folder pathname interactiviate from
this cell into the search sequence in the macro lines?
I think its something in tje line beginning with "Workfile ...." below


Dim WorkFile As String
Dim i As Integer
i = 1
WorkFile = Dir(ThisWorkbook.Path & "\*.*")
Do While WorkFile <> ""
Cells(i, 1).Value = WorkFile
WorkFile = Dir()
i = i + 1
Loop

Thankfully regards
Snoopy
 
J

JP

Is this what you wanted??

Dim WorkFile As String
Dim i As Integer
i = 1
WorkFile = Dir(ThisWorkbook.Path & "\*.*")
Do While WorkFile <> ""
Cells(i, 1).Value = ThisWorkbook.Path & Application.PathSeparator &
WorkFile
WorkFile = Dir()
i = i + 1
Loop

--JP
 
S

Snoopy

Is this what you wanted??

Dim WorkFile As String
Dim i As Integer
i = 1
WorkFile = Dir(ThisWorkbook.Path & "\*.*")
Do While WorkFile <> ""
Cells(i, 1).Value = ThisWorkbook.Path & Application.PathSeparator &
WorkFile
   WorkFile = Dir()
   i = i + 1
Loop

--JP






– Vis sitert tekst –

Thansks for your help JP
Actually this wont work :( maybe my describtion was some kind of
vague:

This is what I try to do:
Using my Excelfile/workbook: GENERATOR.XLSM
In this workbook, in sheet: "Parameter Input" / value in celle A1 ,
the path to folder is given (and to be change when required)
In sheet "Document List" / column A: all file-names in the given path
(value in Document List!A1 will be listed)
By using a hyperlink-formula I will generate a hyperlink fuction (in
column B) to all values in the list + other stuff.

My macro so far do all the stuff - except the interactive pathfinder.

Will you please help me whit this?
Best Regards Snoopy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top