View Single Post
 
Old 09-24-2020, 04:51 PM
leeqiang leeqiang is offline Windows 10 Office 2019
Advanced Beginner
 
Join Date: Aug 2020
Posts: 49
leeqiang is on a distinguished road
Default

Quote:
Originally Posted by NoSparks View Post
put before end sub
Code:
    With ActiveSheet
    For Each cel In .Range("B2", .Range("B" & .Rows.Count).End(xlUp))
        .Hyperlinks.Add Anchor:=.Cells(cel.Row, cel.Column), Address:=cel.Offset(, 2) & "/" & cel & cel.Offset(, -1)
    Next cel
    End With

Thank you very much for your help, your code solved my problem.
If you don’t mind, can you help me solve a few further problems? Modified on the basis of this code to achieve the following 4 purposes:



The first one: The data in column D generated by the code is named path, but all the addresses in this column know the folder, and now I want to modify the path of each file to the full path name, that is, there is a file after the original path file name. That is to say, this path is a hyperlink and you can click to open the file directly, but the data in column D shows the complete path.



The second one: add an E column named the creation date of the file. After traversing each file, the creation date of each corresponding file is generated in this column.



Third: Add a column F named file modification date. After traversing each file, the last modification date of each corresponding file is generated in this column.



Fourth: Add a G column named file size, and generate the file size of each corresponding file in this column after traversing each file.

Thanks again, hope to help me!
Reply With Quote