Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copy and rename files from hyperlink

Dear all,

Thanks Tom for the 'Hyperlink' answer to my original query. I am hoping
that someone can help me with a new problem?

I have a series of hyperlinks to specific (tif) files in Column A. What
I would like to achieve is an automated process that can:

1. Search all hyperlinks in Column A
2. Copy these files to a temporary folder (eg, C:\tmp), and
3. (In the copy process) rename these files to 1.tif, 2.tif, 3.tif, etc
(perhaps with a for loop).

I have (up to and including) 3199 Rows of data.

Hopefully that makes some sense. Any help would be greatly appreciated.

Andy

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy and rename files from hyperlink

It might be easier use your original data


Assume as in the original, that the data is in columns A, B, C, D
Dim rng as range, cell as range
Dim sName as String
set rng = Range(cells(1,1),Cells(1,1).End(xldown))
for each cell in rng
sName = cell.Value & cell.Offset(0,1).Value & "_" & _
cell.offset(0,2).Value & "_" & cell.Offset(0,30.Value _
& ".tif"
filecopy sName, "C:\tmp\" & c.row & ".tif"
Next

Or,
Dim hlink as hyperlink
Dim i as long

i = 0
for each hlink in ActiveSheet.Hyperlinks
if hlink.rng.Column = 1 then
i = i + 1
filecopy hlink.Address, "C:\tmp\ & i & ".tif"
end if
Next

The above assume that hlink.Address will produce the fully qualified path
and filename for the file to copy. (I assume it will, but haven't tested
it).


--
Regards,
Tom Ogilvy


"Andy Weller" wrote in message
...
Dear all,

Thanks Tom for the 'Hyperlink' answer to my original query. I am hoping
that someone can help me with a new problem?

I have a series of hyperlinks to specific (tif) files in Column A. What
I would like to achieve is an automated process that can:

1. Search all hyperlinks in Column A
2. Copy these files to a temporary folder (eg, C:\tmp), and
3. (In the copy process) rename these files to 1.tif, 2.tif, 3.tif, etc
(perhaps with a for loop).

I have (up to and including) 3199 Rows of data.

Hopefully that makes some sense. Any help would be greatly appreciated.

Andy



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What hyperlink method if any supports target rename? [email protected] Links and Linking in Excel 1 October 4th 07 12:13 PM
How do I rename files that are related. FinnSchH2 Excel Discussion (Misc queries) 2 August 31st 07 02:12 PM
Help to rename files Hilton Excel Worksheet Functions 7 July 7th 07 03:51 AM
How to create a copy of a folder having five files in it, & rename Matthews Excel Worksheet Functions 1 November 7th 06 03:42 PM
Copy worksheet from multiple files in one DIR to another DIR & rename Mike Taylor Excel Programming 1 July 13th 03 03:28 PM


All times are GMT +1. The time now is 03:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"