Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Macro help - Moving 2 cells from 100 separate files into new folder

I am opening 100 excel files at a time and I need to do the following:

Create a macro in a new Excel file that will copy two cells from each
of the 100 files and put them next to each other in separate columns.
I will then need to open another 100 files and have the macro perform
the same function, but obviously adding the new new data below the
original data.

The data is in the same location in all the files, and the worksheets
have the same name. Please send a quick macro that I could use for
this purpose.

Thank you.

Steven

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Macro help - Moving 2 cells from 100 separate files into new folder

You can start here
http://www.rondebruin.nl/copy3.htm

See example 3
Not open the files yourself (the code will do that)



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Steven" wrote in message ups.com...
I am opening 100 excel files at a time and I need to do the following:

Create a macro in a new Excel file that will copy two cells from each
of the 100 files and put them next to each other in separate columns.
I will then need to open another 100 files and have the macro perform
the same function, but obviously adding the new new data below the
original data.

The data is in the same location in all the files, and the worksheets
have the same name. Please send a quick macro that I could use for
this purpose.

Thank you.

Steven

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Macro help - Moving 2 cells from 100 separate files into new folder

How about checking out and adapt

http://www.rondebruin.nl/copy3.htm



--
Regards,

Peo Sjoblom



"Steven" wrote in message
ups.com...
I am opening 100 excel files at a time and I need to do the following:

Create a macro in a new Excel file that will copy two cells from each
of the 100 files and put them next to each other in separate columns.
I will then need to open another 100 files and have the macro perform
the same function, but obviously adding the new new data below the
original data.

The data is in the same location in all the files, and the worksheets
have the same name. Please send a quick macro that I could use for
this purpose.

Thank you.

Steven



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Macro help - Moving 2 cells from 100 separate files into new folder


Thank you Ron.

Steven

On Jul 10, 1:54 pm, "Ron de Bruin" wrote:
You can start herehttp://www.rondebruin.nl/copy3.htm

See example 3
Not open the files yourself (the code will do that)

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm

"Steven" wrote in oglegroups.com...
I am opening 100 excel files at a time and I need to do the following:


Create a macro in a new Excel file that will copy two cells from each
of the 100 files and put them next to each other in separate columns.
I will then need to open another 100 files and have the macro perform
the same function, but obviously adding the new new data below the
original data.


The data is in the same location in all the files, and the worksheets
have the same name. Please send a quick macro that I could use for
this purpose.


Thank you.


Steven



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Macro help - Moving 2 cells from 100 separate files into new folder

Thank you Peo.


On Jul 10, 1:56 pm, "Peo Sjoblom" wrote:
How about checking out and adapt

http://www.rondebruin.nl/copy3.htm

--
Regards,

Peo Sjoblom

"Steven" wrote in message

ups.com...

I am opening 100 excel files at a time and I need to do the following:


Create a macro in a new Excel file that will copy two cells from each
of the 100 files and put them next to each other in separate columns.
I will then need to open another 100 files and have the macro perform
the same function, but obviously adding the new new data below the
original data.


The data is in the same location in all the files, and the worksheets
have the same name. Please send a quick macro that I could use for
this purpose.


Thank you.


Steven





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Macro help - Moving 2 cells from 100 separate files into new folder

Steven,

Did you try my macro from your previous post? No need to open the files (which just slows things
down).

****************************************

Try the sub below, which will create links to cells A1, B1, and C1 of Sheet1 in every file in the
folder

"C:\Documents and Settings\Owner\My Documents\Subject Profile Summary LBJ"


HTH,
Bernie
MS Excel MVP

Sub CreateLinksToMulitpleFiles()
Dim MyFormula As String
Dim myCount As Integer
myCount = 1

With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\Owner\My Documents\Subject Profile Summary LBJ"
.FileType = msoFileTypeExcelWorkbooks
If .Execute 0 Then
For i = 1 To .FoundFiles.Count
'Generate Formulas through string manipulation
MyFormula = "='" & .LookIn & "\[" & _
Application.Substitute(.FoundFiles(i), .LookIn & "\", "") _
& "]Sheet1'!A1"
'Set cell formula
Cells(myCount, 3).Formula = MyFormula
MyFormula = "='" & .LookIn & "\[" & _
Application.Substitute(.FoundFiles(i), .LookIn & "\", "") _
& "]Sheet1'!B1"
'Set cell formula
Cells(myCount, 4).Formula = MyFormula
MyFormula = "='" & .LookIn & "\[" & _
Application.Substitute(.FoundFiles(i), .LookIn & "\", "") _
& "]Sheet1'!C1"
'Set cell formula
Cells(myCount, 5).Formula = MyFormula
myCount = myCount + 1
Next i
End If
End With
End Sub

"Steven" wrote in message
ups.com...
I am opening 100 excel files at a time and I need to do the following:

Create a macro in a new Excel file that will copy two cells from each
of the 100 files and put them next to each other in separate columns.
I will then need to open another 100 files and have the macro perform
the same function, but obviously adding the new new data below the
original data.

The data is in the same location in all the files, and the worksheets
have the same name. Please send a quick macro that I could use for
this purpose.

Thank you.

Steven



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Macro help - Moving 2 cells from 100 separate files into new folder

Another one similar
http://www.rondebruin.nl/summary2.htm

With Application.FileSearch

Is gone in 2007



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message ...
Steven,

Did you try my macro from your previous post? No need to open the files (which just slows things
down).

****************************************

Try the sub below, which will create links to cells A1, B1, and C1 of Sheet1 in every file in the
folder

"C:\Documents and Settings\Owner\My Documents\Subject Profile Summary LBJ"


HTH,
Bernie
MS Excel MVP

Sub CreateLinksToMulitpleFiles()
Dim MyFormula As String
Dim myCount As Integer
myCount = 1

With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\Owner\My Documents\Subject Profile Summary LBJ"
.FileType = msoFileTypeExcelWorkbooks
If .Execute 0 Then
For i = 1 To .FoundFiles.Count
'Generate Formulas through string manipulation
MyFormula = "='" & .LookIn & "\[" & _
Application.Substitute(.FoundFiles(i), .LookIn & "\", "") _
& "]Sheet1'!A1"
'Set cell formula
Cells(myCount, 3).Formula = MyFormula
MyFormula = "='" & .LookIn & "\[" & _
Application.Substitute(.FoundFiles(i), .LookIn & "\", "") _
& "]Sheet1'!B1"
'Set cell formula
Cells(myCount, 4).Formula = MyFormula
MyFormula = "='" & .LookIn & "\[" & _
Application.Substitute(.FoundFiles(i), .LookIn & "\", "") _
& "]Sheet1'!C1"
'Set cell formula
Cells(myCount, 5).Formula = MyFormula
myCount = myCount + 1
Next i
End If
End With
End Sub

"Steven" wrote in message
ups.com...
I am opening 100 excel files at a time and I need to do the following:

Create a macro in a new Excel file that will copy two cells from each
of the 100 files and put them next to each other in separate columns.
I will then need to open another 100 files and have the macro perform
the same function, but obviously adding the new new data below the
original data.

The data is in the same location in all the files, and the worksheets
have the same name. Please send a quick macro that I could use for
this purpose.

Thank you.

Steven



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Macro help - Moving 2 cells from 100 separate files into new folder

Yes. I couldn't get it to work for some reason. Thank you, but I think
it was a bit complicated for me. I had downloaded an add-in from this
thread that seems to do the job perfectly.

Steven


On Jul 10, 2:20 pm, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:
Steven,

Did you try my macro from your previous post? No need to open the files (which just slows things
down).

****************************************

Try the sub below, which will create links to cells A1, B1, and C1 of Sheet1 in every file in the
folder

"C:\Documents and Settings\Owner\My Documents\Subject Profile Summary LBJ"

HTH,
Bernie
MS Excel MVP

Sub CreateLinksToMulitpleFiles()
Dim MyFormula As String
Dim myCount As Integer
myCount = 1

With Application.FileSearch
.NewSearch
.LookIn = "C:\Documents and Settings\Owner\My Documents\Subject Profile Summary LBJ"
.FileType = msoFileTypeExcelWorkbooks
If .Execute 0 Then
For i = 1 To .FoundFiles.Count
'Generate Formulas through string manipulation
MyFormula = "='" & .LookIn & "\[" & _
Application.Substitute(.FoundFiles(i), .LookIn & "\", "") _
& "]Sheet1'!A1"
'Set cell formula
Cells(myCount, 3).Formula = MyFormula
MyFormula = "='" & .LookIn & "\[" & _
Application.Substitute(.FoundFiles(i), .LookIn & "\", "") _
& "]Sheet1'!B1"
'Set cell formula
Cells(myCount, 4).Formula = MyFormula
MyFormula = "='" & .LookIn & "\[" & _
Application.Substitute(.FoundFiles(i), .LookIn & "\", "") _
& "]Sheet1'!C1"
'Set cell formula
Cells(myCount, 5).Formula = MyFormula
myCount = myCount + 1
Next i
End If
End With
End Sub

"Steven" wrote in message

ups.com...

I am opening 100 excel files at a time and I need to do the following:


Create a macro in a new Excel file that will copy two cells from each
of the 100 files and put them next to each other in separate columns.
I will then need to open another 100 files and have the macro perform
the same function, but obviously adding the new new data below the
original data.


The data is in the same location in all the files, and the worksheets
have the same name. Please send a quick macro that I could use for
this purpose.


Thank you.


Steven



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
Macro to create a folder and copy files GainesvilleWes New Users to Excel 2 February 26th 07 06:33 PM
Path and Number of files in a folder. - Pass to Macro. Richard Excel Discussion (Misc queries) 1 December 21st 06 09:20 PM
Copying Cells from CSV files in folder into one worksheet [email protected] Excel Discussion (Misc queries) 1 June 23rd 06 09:23 PM
Linking cells to files in a folder beginnerExceluser New Users to Excel 1 October 4th 05 06:41 AM
Macro to copy range from Excel files in folder nc Excel Discussion (Misc queries) 1 June 15th 05 11:11 AM


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

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"