LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.newusers
Liz Liz is offline
external usenet poster
 
Posts: 133
Default Copying Multiple files in one file Macro - Liz

Hi,

I recorded this macro to copy the data from a particular formatted file to a
normal worksheet. In order to get it in a normal format (All Testing
Results.xls) in order to import it to my Database Table. And it worked. Now
I'm in a process to creat a macro that will automate the process of going to
that folder (C:\To Figure Out\) and copy all the datas from the different
files that is in that folder and copy it in my normal worksheet (All Testing
Results.xls).

Please help.

Here's the Macro that I recorded to copy paste my data in normal format to
All Testing Results.xls and it worked.

Sub UpdateWTAuditResults()
'
' UpdateWTAuditResults Macro
' Macro recorded 3/8/2007 by Elizabeth B Cherian
'

'
Workbooks.Open Filename:="C:\To Figure out\WTKLoder102406.xls"
Range("F7:G7").Select
Selection.Copy
Windows("All Testing Results.xls").Activate
Range("B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Windows("WTKLoder102406.xls").Activate
Range("F5:G5").Select
Application.CutCopyMode = False
Selection.Copy
Windows("WTKLoder121506.xls").Activate
Windows("All Testing Results.xls").Activate
Range("C2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("E2").Select
Windows("WTKLoder102406.xls").Activate
Range("B7:C7").Select
Application.CutCopyMode = False
Selection.Copy
Windows("All Testing Results.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Columns("E:E").ColumnWidth = 10.43
Range("E2").Select
Application.CutCopyMode = False
Selection.Cut
Range("F2").Select
ActiveSheet.Paste
Range("E2").Select
ActiveCell.FormulaR1C1 = "CREBnkg"
Range("H2").Select
Windows("WTKLoder102406.xls").Activate
Range("B9:C9").Select
Selection.Copy
Windows("WTKLoder121506.xls").Activate
Windows("All Testing Results.xls").Activate
Range("I2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("J2").Select
Windows("WTKLoder102406.xls").Activate
Range("B5:C5").Select
Application.CutCopyMode = False
Selection.Copy
Windows("All Testing Results.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("K2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "Monthly"
Range("L2").Select
ActiveCell.FormulaR1C1 = "43"
Range("N2").Select
ActiveCell.FormulaR1C1 = "WT"
Range("O2").Select
ActiveCell.FormulaR1C1 = "Wire Transfer"
Range("P2").Select
Windows("WTKLoder102406.xls").Activate
Range("A15:D57").Select
Selection.Copy
Windows("All Testing Results.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("AB2").Select
Windows("WTKLoder102406.xls").Activate
Range("E15:E57").Select
Application.CutCopyMode = False
Selection.Copy
Windows("All Testing Results.xls").Activate
ActiveSheet.Paste
Range("AE2").Select
Windows("WTKLoder102406.xls").Activate
Range("F15:F57").Select
Application.CutCopyMode = False
Selection.Copy
Windows("All Testing Results.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("AM2").Select
Windows("WTKLoder102406.xls").Activate
Range("G15:N57").Select
Application.CutCopyMode = False
Selection.Copy
Windows("All Testing Results.xls").Activate
Range("AF2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("B2:O2").Select
Application.CutCopyMode = False
Selection.Copy
Range("B3:B44").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A2:AM44").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("C59").Select
ActiveWorkbook.Save
End Sub


 
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: Filter Multiple header then extract to Multiple Files [email protected] Excel Discussion (Misc queries) 9 December 8th 06 10:44 PM
Copying data to multiple worksheets by Macro lqfong Excel Discussion (Misc queries) 0 June 26th 06 03:57 AM
Opening Multiple files and Copying the info all to one other sheet MsLucy Excel Discussion (Misc queries) 2 January 6th 06 05:41 PM
macro for copying file Joseph Excel Discussion (Misc queries) 1 August 24th 05 02:07 PM
Help with Macro (copying data from multiple workbooks) Tim Harding Excel Discussion (Misc queries) 1 February 5th 05 10:37 PM


All times are GMT +1. The time now is 11:35 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"