Prince Dubey ,
 
Thanks for the last code update it works great. I have one other problem 
how can I modify this code where
Range("I" & i) = f.Name  is soreted so that the oldest file is displayed on 
top?
 
thnaks in advance.
 

On Thursday, September 27, 2012 10:52:04 PM UTC-5, Prince Dubey wrote:

> Hi Friend,
>
> I hope this will help you.
>
> Private Sub FolderRead(ByRef myFolder)
> Dim countf  As String
> countf = 0
>
>    For Each f In myFolder.Files
>     Var = f.Path
>     If Right(f.Name, 4) = ".pdf" Or Right(f.Name, 4) = ".tif" Then
>         i = i + 1
>         ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), _
>             Address:=f.Path, TextToDisplay:=f.Name & "          " & f
>         Range("I" & i) = f.Name 'mer added
>         Range("J" & i) = rootfolder & "\" 'mer added
>        * Range("K" & i) = f.DateCreated*
>     countf = countf + 1
>     End If
>     
>    Next f
>    Range("E1") = "# Of Documents is: " & countf
> countf = 0
> End Sub
>
>
> Regards
> Prince
>
>
> On Friday, September 28, 2012 3:21:11 AM UTC+5:30, Best Of Luck wrote:
>>
>> Hello Group:
>>  
>> *I am using the code below to read a directory and create hyperlinks 
>> from the files but now I need to insert the file creation date also .How 
>> can modify this code to do this.*
>> *Here is the code*:
>>  
>> *Private Sub FolderRead(ByRef myFolder)
>> Dim countf As String
>> countf = 0
>>    For Each f In myFolder.Files
>>     Var = f.Path
>>     If Right(f.Name, 4) = ".pdf" Or Right(f.Name, 4) = ".tif" Then
>>         i = i + 1
>>         ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & i), _
>>             Address:=f.Path, TextToDisplay:=f.Name & "          " & f
>>              
>>         Range("I" & i) = f.Name 'mer added
>>         Range("J" & i) = rootfolder & "\" 'mer added
>>     countf = countf + 1
>>     End If
>>     
>>    Next f
>>    Range("E1") = "# Of Documents is: " & countf
>> countf = 0
>> End Sub*
>>
>

-- 
Join official facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES (1120+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

6) Jobs posting is not allowed.

7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed.

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To post to this group, send email to excel-macros@googlegroups.com.
To unsubscribe from this group, send email to 
excel-macros+unsubscr...@googlegroups.com.


Reply via email to