Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 09-24-2020, 04:51 PM
leeqiang leeqiang is offline How to modify the code to meet the corresponding requirements Windows 10 How to modify the code to meet the corresponding requirements Office 2019
Advanced Beginner
How to modify the code to meet the corresponding requirements
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add file name automatically in the vba code ... LearnerExcel Excel 3 12-30-2019 06:11 AM
How to modify the code to meet the corresponding requirements vb code for updating file automatically klpw Excel Programming 1 01-14-2016 08:05 PM
How to modify the code to meet the corresponding requirements Auto Save Every Page(s) as a separate file, and name each new file automatically by the first line? commissarmo Word VBA 3 03-14-2015 12:53 AM
How to modify the code to meet the corresponding requirements How to convert a text file to an Excel file with the data format automatically? mradmin Excel 6 10-16-2013 10:34 AM
How to modify the code to meet the corresponding requirements How to copy automatically data from Excel file to Word file? fuchsd Word 6 10-25-2011 05:52 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft