Hello Everyone,
I have a recorded a short macro and was wondering if anyone can tell me how to run it simultaneously on 10 different excel documents or workbooks? I have Excel 2010. The macro Is as below -
Thank you,
Harsh
I have a recorded a short macro and was wondering if anyone can tell me how to run it simultaneously on 10 different excel documents or workbooks? I have Excel 2010. The macro Is as below -
Code:
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+a
'
Cells.Select
Cells.EntireColumn.AutoFit
Range("D1").Select
ActiveCell.FormulaR1C1 = "Policy Numbers"
Range("H1").Select
ActiveCell.FormulaR1C1 = "Errors"
Columns("H:H").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
Rows("1:1").Select
Range("D1").Activate
Selection.AutoFilter
ActiveSheet.Range("$A$1:$L$415").AutoFilter Field:=4, Criteria1:="<>"
Columns("D:D").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
Columns("H:H").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
Columns("D:D").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveSheet.Range("$A$1:$L$415").AutoFilter Field:=8, Criteria1:= _
"<>Number*", Operator:=xlAnd, Criteria2:="<>Product*"
ActiveWindow.SmallScroll Down:=-12
Columns("H:H").Select
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
Columns("D:D").Select
Selection.TextToColumns Destination:=Range("D1"), DataType:=xlDelimited, _
TextQualifier:=xlSingleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="'", FieldInfo:=Array(Array(1, 2), Array(2, 2), Array(3, 1)), _
TrailingMinusNumbers:=True
Range("D1").Select
Selection.Cut
Range("E1").Select
ActiveSheet.Paste
Columns("E:E").Select
ActiveWindow.ScrollColumn = 4
Range("E:E,H:H").Select
Range("H1").Activate
Selection.Copy
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Paste
Cells.Select
Cells.EntireColumn.AutoFit
Range("D11").Select
End Sub
Thank you,
Harsh