Why can you not just post your Macro code here in the forum. We should not be asked to download your code from a link you have provided. Links can always be dangerous.
Hi, I have earlier replied with the worksheets and the Macro code but not sure why it needs to be sent to the admin of this forum for approval and until now, that reply has not been posted yet. I'll send here again and see if gets to the admin again.
Below is the sample data for 5 worksheets. Each worksheet represents an Equipment.
This is EquipmentA
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]EquipmentA[/TD]
[TD]PartA[/TD]
[TD]Area9[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]EquipmentA[/TD]
[TD]PartA[/TD]
[TD]Area11[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]EquipmentA[/TD]
[TD]PartD[/TD]
[TD]Area9[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]EquipmentA[/TD]
[TD]PartF[/TD]
[TD]Area11[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]EquipmentA[/TD]
[TD]PartB[/TD]
[TD]Area7[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]EquipmentA[/TD]
[TD]PartA[/TD]
[TD]Area2[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]EquipmentA[/TD]
[TD]PartA[/TD]
[TD]Area8[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]EquipmentA[/TD]
[TD]PartA[/TD]
[TD]Area10[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]EquipmentA[/TD]
[TD]PartB[/TD]
[TD]Area6[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]EquipmentA[/TD]
[TD]PartA[/TD]
[TD]Area1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]EquipmentA[/TD]
[TD]PartC[/TD]
[TD]Area2[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]EquipmentA[/TD]
[TD]PartA[/TD]
[TD]Area7[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]EquipmentA[/TD]
[TD]PartD[/TD]
[TD]Area11[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]EquipmentA[/TD]
[TD]PartG[/TD]
[TD]Area9[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]EquipmentA[/TD]
[TD]PartA[/TD]
[TD]Area8[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD]EquipmentA[/TD]
[TD]PartB[/TD]
[TD]Area6[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]18[/TD]
[TD]EquipmentA[/TD]
[TD]PartK[/TD]
[TD]Area10[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]19[/TD]
[TD]EquipmentA[/TD]
[TD]PartA[/TD]
[TD]Area10[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]EquipmentA[/TD]
[TD]PartA[/TD]
[TD]Area8[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]
This is EquipmentB.
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]EquipmentB[/TD]
[TD]PartA[/TD]
[TD]Area9[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]EquipmentB[/TD]
[TD]PartA[/TD]
[TD]Area8[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]EquipmentB[/TD]
[TD]PartA[/TD]
[TD]Area11[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]EquipmentB[/TD]
[TD]PartA[/TD]
[TD]Area10[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]EquipmentB[/TD]
[TD]PartD[/TD]
[TD]Area9[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]EquipmentB[/TD]
[TD]PartA[/TD]
[TD]Area8[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]EquipmentB[/TD]
[TD]PartF[/TD]
[TD]Area11[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]EquipmentB[/TD]
[TD]PartB[/TD]
[TD]Area6[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]EquipmentB[/TD]
[TD]PartA[/TD]
[TD]Area2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]EquipmentB[/TD]
[TD]PartG[/TD]
[TD]Area9[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]EquipmentB[/TD]
[TD]PartA[/TD]
[TD]Area8[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]EquipmentB[/TD]
[TD]PartD[/TD]
[TD]Area11[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]EquipmentB[/TD]
[TD]PartA[/TD]
[TD]Area10[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]EquipmentB[/TD]
[TD]PartA[/TD]
[TD]Area7[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]EquipmentB[/TD]
[TD]PartB[/TD]
[TD]Area6[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD]EquipmentB[/TD]
[TD]PartC[/TD]
[TD]Area2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]18[/TD]
[TD]EquipmentB[/TD]
[TD]PartA[/TD]
[TD]Area1[/TD]
[TD="align: right"]1[/TD]
[/TR]
</tbody>[/TABLE]
This is EquipmentC.
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]EquipmentC[/TD]
[TD]PartA[/TD]
[TD]Area1[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]EquipmentC[/TD]
[TD]PartB[/TD]
[TD]Area6[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]EquipmentC[/TD]
[TD]PartA[/TD]
[TD]Area10[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]EquipmentC[/TD]
[TD]PartD[/TD]
[TD]Area11[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]EquipmentC[/TD]
[TD]PartG[/TD]
[TD]Area9[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]EquipmentC[/TD]
[TD]PartB[/TD]
[TD]Area6[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]EquipmentC[/TD]
[TD]PartB[/TD]
[TD]Area7[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]EquipmentC[/TD]
[TD]PartA[/TD]
[TD]Area8[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]EquipmentC[/TD]
[TD]PartA[/TD]
[TD]Area2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]EquipmentC[/TD]
[TD]PartK[/TD]
[TD]Area10[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]EquipmentC[/TD]
[TD]PartA[/TD]
[TD]Area8[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]EquipmentC[/TD]
[TD]PartA[/TD]
[TD]Area11[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]EquipmentC[/TD]
[TD]PartA[/TD]
[TD]Area9[/TD]
[TD="align: right"]1[/TD]
[/TR]
</tbody>[/TABLE]
This is EquipmentD.
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]EquipmentD[/TD]
[TD]PartA[/TD]
[TD]Area1[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]EquipmentD[/TD]
[TD]PartB[/TD]
[TD]Area6[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]EquipmentD[/TD]
[TD]PartA[/TD]
[TD]Area10[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]EquipmentD[/TD]
[TD]PartA[/TD]
[TD]Area8[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]EquipmentD[/TD]
[TD]PartA[/TD]
[TD]Area2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]EquipmentD[/TD]
[TD]PartB[/TD]
[TD]Area7[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]EquipmentD[/TD]
[TD]PartF[/TD]
[TD]Area11[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]EquipmentD[/TD]
[TD]PartD[/TD]
[TD]Area9[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]EquipmentD[/TD]
[TD]PartA[/TD]
[TD]Area11[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]EquipmentD[/TD]
[TD]PartA[/TD]
[TD]Area7[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]EquipmentD[/TD]
[TD]PartD[/TD]
[TD]Area11[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]EquipmentD[/TD]
[TD]PartG[/TD]
[TD]Area9[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]EquipmentD[/TD]
[TD]PartB[/TD]
[TD]Area6[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]EquipmentD[/TD]
[TD]PartK[/TD]
[TD]Area10[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]EquipmentD[/TD]
[TD]PartA[/TD]
[TD]Area8[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD]EquipmentD[/TD]
[TD]PartA[/TD]
[TD]Area10[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]18[/TD]
[TD]EquipmentD[/TD]
[TD]PartA[/TD]
[TD]Area8[/TD]
[TD="align: right"]2[/TD]
[/TR]
</tbody>[/TABLE]
This is EquipmentE.
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]EquipmentE[/TD]
[TD]PartA[/TD]
[TD]Area9[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]EquipmentE[/TD]
[TD]PartA[/TD]
[TD]Area11[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]EquipmentE[/TD]
[TD]PartD[/TD]
[TD]Area9[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]EquipmentE[/TD]
[TD]PartF[/TD]
[TD]Area11[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]EquipmentE[/TD]
[TD]PartB[/TD]
[TD]Area7[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]EquipmentE[/TD]
[TD]PartA[/TD]
[TD]Area2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]EquipmentE[/TD]
[TD]PartA[/TD]
[TD]Area8[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]EquipmentE[/TD]
[TD]PartA[/TD]
[TD]Area10[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]EquipmentE[/TD]
[TD]PartB[/TD]
[TD]Area6[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]EquipmentE[/TD]
[TD]PartA[/TD]
[TD]Area1[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]EquipmentE[/TD]
[TD]PartC[/TD]
[TD]Area2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]EquipmentE[/TD]
[TD]PartA[/TD]
[TD]Area7[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]EquipmentE[/TD]
[TD]PartK[/TD]
[TD]Area10[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]EquipmentE[/TD]
[TD]PartA[/TD]
[TD]Area10[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]EquipmentE[/TD]
[TD]PartA[/TD]
[TD]Area8[/TD]
[TD="align: right"]2[/TD]
[/TR]
</tbody>[/TABLE]
This is Macro1.
Sub Macro1()
'
' Macro1 Macro
'
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "Equipment No."
Range("B1").Select
ActiveCell.FormulaR1C1 = "Part No."
Range("C1").Select
ActiveCell.FormulaR1C1 = "Area where Part is used"
Range("D1").Select
ActiveCell.FormulaR1C1 = "Qty"
Selection.End(xlToLeft).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Application.Goto Reference:="R100C1"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll Down:=12
Application.CutCopyMode = False
ActiveWorkbook.Worksheets("EquipmentA").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("EquipmentA").Sort.SortFields.Add Key:=Range( _
"B101:B119"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("EquipmentA").Sort
.SetRange Range("A100:D119")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWindow.SmallScroll Down:=6
Range("B100").Select
Selection.AutoFilter
ActiveSheet.Range("$A$100:$D$119").AutoFilter Field:=2, Criteria1:="PartA"
Range("A100").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Application.Goto Reference:="R200C1"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.SmallScroll Down:=12
End Sub
Pls help me with the code to automate running Macro1 for the 500 worksheets. Thanks.