Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Intotao
 
Posts: n/a
Default Copy files from spreadsheet into folder

Hi Everyone,
My question is this. I have a spreadsheet with 350 files (and directory
paths) listed, all in column A. What I want to do is this. Copy all of these
files into 1 new folder called temp. Does anyone know a quick way to do this?

Second problem, Does anyone know a way to create hyperlinks from all 350,
without selecting individual and then changing?
I've tried a Macro - but it doesn't work because it requires each one to be
specifically pointing toward a file, on an individual basis.

MANY thanks in advance,

  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

#1:

Option Explicit
Sub testme01()

Dim myCell As Range
Dim myRng As Range
Dim testStr As String

With Worksheets("sheet1")
Set myRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))
For Each myCell In myRng.Cells
testStr = ""
On Error Resume Next
testStr = Dir(myCell.Value)
On Error GoTo 0
If testStr = "" Then
'not found
myCell.Offset(0, 2).Value = "missing"
Else
FileCopy Source:=myCell.Value, _
Destination:="C:\temp"
End If
Next myCell
End With
End Sub

#2:

In B1 and dragged down.
=hyperlink(a1)


Intotao wrote:

Hi Everyone,
My question is this. I have a spreadsheet with 350 files (and directory
paths) listed, all in column A. What I want to do is this. Copy all of these
files into 1 new folder called temp. Does anyone know a quick way to do this?

Second problem, Does anyone know a way to create hyperlinks from all 350,
without selecting individual and then changing?
I've tried a Macro - but it doesn't work because it requires each one to be
specifically pointing toward a file, on an individual basis.

MANY thanks in advance,


--

Dave Peterson
  #3   Report Post  
Intotao
 
Posts: n/a
Default

Thanks for your response Dave. Much appreciated.
However after trying the code I keep getting a
"Run time error 75 Path/file Access error"

I've checked and made sure the file and directory was correct. Were there
any other conditions I need to meet for this to work?

Just curious,

Many thanks again,

"Dave Peterson" wrote:

#1:

Option Explicit
Sub testme01()

Dim myCell As Range
Dim myRng As Range
Dim testStr As String

With Worksheets("sheet1")
Set myRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))
For Each myCell In myRng.Cells
testStr = ""
On Error Resume Next
testStr = Dir(myCell.Value)
On Error GoTo 0
If testStr = "" Then
'not found
myCell.Offset(0, 2).Value = "missing"
Else
FileCopy Source:=myCell.Value, _
Destination:="C:\temp"
End If
Next myCell
End With
End Sub

#2:

In B1 and dragged down.
=hyperlink(a1)


Intotao wrote:

Hi Everyone,
My question is this. I have a spreadsheet with 350 files (and directory
paths) listed, all in column A. What I want to do is this. Copy all of these
files into 1 new folder called temp. Does anyone know a quick way to do this?

Second problem, Does anyone know a way to create hyperlinks from all 350,
without selecting individual and then changing?
I've tried a Macro - but it doesn't work because it requires each one to be
specifically pointing toward a file, on an individual basis.

MANY thanks in advance,


--

Dave Peterson

  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

I pasted into C:\temp

Did you modify that to the folder that you wanted to use?

If you did, post back with a little more info--what line blew up?


Intotao wrote:

Thanks for your response Dave. Much appreciated.
However after trying the code I keep getting a
"Run time error 75 Path/file Access error"

I've checked and made sure the file and directory was correct. Were there
any other conditions I need to meet for this to work?

Just curious,

Many thanks again,

"Dave Peterson" wrote:

#1:

Option Explicit
Sub testme01()

Dim myCell As Range
Dim myRng As Range
Dim testStr As String

With Worksheets("sheet1")
Set myRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))
For Each myCell In myRng.Cells
testStr = ""
On Error Resume Next
testStr = Dir(myCell.Value)
On Error GoTo 0
If testStr = "" Then
'not found
myCell.Offset(0, 2).Value = "missing"
Else
FileCopy Source:=myCell.Value, _
Destination:="C:\temp"
End If
Next myCell
End With
End Sub

#2:

In B1 and dragged down.
=hyperlink(a1)


Intotao wrote:

Hi Everyone,
My question is this. I have a spreadsheet with 350 files (and directory
paths) listed, all in column A. What I want to do is this. Copy all of these
files into 1 new folder called temp. Does anyone know a quick way to do this?

Second problem, Does anyone know a way to create hyperlinks from all 350,
without selecting individual and then changing?
I've tried a Macro - but it doesn't work because it requires each one to be
specifically pointing toward a file, on an individual basis.

MANY thanks in advance,


--

Dave Peterson


--

Dave Peterson
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
Copy and pasting graphs to PowerPoint JZip Excel Discussion (Misc queries) 0 January 6th 05 08:29 PM
Problems opening Excel files using DFS links Byron Excel Discussion (Misc queries) 2 January 1st 05 11:31 PM
copy qualifying rows to another spreadsheet acpharmd Excel Worksheet Functions 1 December 29th 04 09:45 PM
How do i save backup copy in a different folder mekraj Excel Discussion (Misc queries) 3 December 17th 04 08:33 PM
Convert excel files to works 8 spreadsheet Mike Excel Discussion (Misc queries) 1 December 13th 04 12:55 PM


All times are GMT +1. The time now is 04:45 AM.

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

About Us

"It's about Microsoft Excel"