?
Solved

[EXCEL] - Reference

Posted on 2003-03-09
12
Medium Priority
?
167 Views
Last Modified: 2012-06-21
hello all

I have a macro, called "test1", its name is "Module1" in Visual Basic Editor
I have another macro called "test2", its name is "Module11" in Visual Basic Editor

in "test1", I have these lines:

For i = intInitialValue To intFinalValue
j = i + 1


my question is,
For "test2" macro, "Module11", instead of redefine "i" & "j" again,
can i just say i = test1's i, and j = test1's j??

if so, how do i write the command?

thanx a lot

0
Comment
Question by:gillesdiva
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 9

Expert Comment

by:pauloaguia
ID: 8099584
What is it you are trying to do? Maybe there is someway to do that if you tell us why you need to do it.

Just as it is my answer would be No. You can't because they are separate procedures. But if test1 is calling test2 in it's code then it can pass the current values of i and j as arguments to that function (as long as the function is expecting them).

What do test1 and test2 do and why do you want to use information from one in the other (and if not very long, post both codes).

Paulo
0
 

Author Comment

by:gillesdiva
ID: 8099650
it's actually very very long...
that is the reason why i had to split it into 2 macros...
cuz.. when i tried to run it, excel said it's too big to run.. that's why i spliited it up into 2...

so it's impossible to simply put " J = test1's definition of J" & "i = test1's definition of i" in test2??


0
 
LVL 50

Expert Comment

by:Dave Brett
ID: 8099660
You should try pauloaguia's suggestion of passing the arguments.

I'm curious as to how big these macros are - I've never seen this error before. If its a macro that you recorded by tracing steps in excel then there is probably a lot of surplus code you could remove or tidy up
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:gillesdiva
ID: 8099668
it's actually very very long...
that is the reason why i had to split it into 2 macros...
cuz.. when i tried to run it, excel said it's too big to run.. that's why i spliited it up into 2...

so it's impossible to simply put " J = test1's definition of J" & "i = test1's definition of i" in test2??


0
 

Author Comment

by:gillesdiva
ID: 8099678
no, the thing is because there are so many steps, and i DID tidy up the macro's already...
 
0
 

Author Comment

by:gillesdiva
ID: 8099694
no one has ever done this before??
i thought it's possible to do this since it's just referring to another macro's definition....
but if not, i guess i'll just have to think of another way then..
0
 

Author Comment

by:gillesdiva
ID: 8099783
Sub Simple_ReplaceData()
   Dim wshSheet2           As Worksheet
   Dim intInitialValue     As Integer
   Dim intFinalValue       As Integer
   Dim i                   As Integer 'counter
   Dim int3P1Row        As Integer
   Dim int3P2Row        As Integer
   Dim int3P3Row        As Integer
   Dim int3P4Row        As Integer
   Dim int3P5Row        As Integer
   Dim int3P6Row        As Integer
   Dim int3P7Row        As Integer
   Dim int3P8Row        As Integer
   Dim int3P9Row        As Integer
   Dim int3P10Row        As Integer
   Dim int3P11Row        As Integer
   Dim int3P12Row        As Integer
   Dim int4P1Row        As Integer
   Dim int4P2Row        As Integer
   Dim int4P3Row        As Integer
   Dim int4P4Row        As Integer
   Dim int4P5Row        As Integer
   Dim int4P6Row        As Integer
   Dim int4P7Row        As Integer
   Dim int4P8Row        As Integer
   Dim int4P9Row        As Integer
   Dim int4P10Row        As Integer
   Dim int4P11Row        As Integer
   Dim int4P12Row        As Integer
   Dim int5P1Row        As Integer
   Dim int5P2Row        As Integer
   Dim int5P3Row        As Integer
   Dim int5P4Row        As Integer
   Dim int5P5Row        As Integer
   Dim int5P6Row        As Integer
   Dim int5P7Row        As Integer
   Dim int5P8Row        As Integer
   Dim int5P9Row        As Integer
   Dim int5P10Row        As Integer
   Dim int5P11Row        As Integer
   Dim int5P12Row        As Integer
   Dim int6P1Row        As Integer
   Dim int6P2Row        As Integer
   Dim int6P3Row        As Integer
   Dim int6P4Row        As Integer
   Dim int6P5Row        As Integer
   Dim int6P6Row        As Integer
   Dim int6P7Row        As Integer
   Dim int6P8Row        As Integer
   Dim int6P9Row        As Integer
   Dim int6P10Row        As Integer
   Dim int6P11Row        As Integer
   Dim int6P12Row        As Integer
   Dim int7P1Row        As Integer
   Dim int7P2Row        As Integer
   Dim int7P3Row        As Integer
   Dim int7P4Row        As Integer
   Dim int7P5Row        As Integer
   Dim int7P6Row        As Integer
   Dim int7P7Row        As Integer
   Dim int7P8Row        As Integer
   Dim int7P9Row        As Integer
   Dim int7P10Row        As Integer
   Dim int7P11Row        As Integer
   Dim int7P12Row        As Integer
   Dim btest   As Boolean
   Set wshSheet2 = ThisWorkbook.Sheets("Sheet2")
   
   intInitialValue = CInt(InputBox("Initial Value:"))
   intFinalValue = CInt(InputBox("Final Value:"))
   int3P1Row = 2
   int3P2Row = 2
   int3P3Row = 2
   int3P4Row = 2
   int3P5Row = 2
   int3P6Row = 2
   int3P7Row = 2
   int3P8Row = 2
   int3P9Row = 2
   int3P10Row = 2
   int3P11Row = 2
   int3P12Row = 2
   int4P1Row = 2
   int4P2Row = 2
   int4P3Row = 2
   int4P4Row = 2
   int4P5Row = 2
   int4P6Row = 2
   int4P7Row = 2
   int4P8Row = 2
   int4P9Row = 2
   int4P10Row = 2
   int4P11Row = 2
   int4P12Row = 2
   int5P1Row = 2
   int5P2Row = 2
   int5P3Row = 2
   int5P4Row = 2
   int5P5Row = 2
   int5P6Row = 2
   int5P7Row = 2
   int5P8Row = 2
   int5P9Row = 2
   int5P10Row = 2
   int5P11Row = 2
   int5P12Row = 2
   int6P1Row = 2
   int6P2Row = 2
   int6P3Row = 2
   int6P4Row = 2
   int6P5Row = 2
   int6P6Row = 2
   int6P7Row = 2
   int6P8Row = 2
   int6P9Row = 2
   int6P10Row = 2
   int6P11Row = 2
   int6P12Row = 2
   int7P1Row = 2
   int7P2Row = 2
   int7P3Row = 2
   int7P4Row = 2
   int7P5Row = 2
   int7P6Row = 2
   int7P7Row = 2
   int7P8Row = 2
   int7P9Row = 2
   int7P10Row = 2
   int7P11Row = 2
   int7P12Row = 2

   For i = intInitialValue To intFinalValue
       
    '   Application.Run "Simple_ab"
       
    j = i + 1
   
    Range("H:M").Select

    Selection.Replace i, _
        Replacement:=j, _
        LookAt:=xlPart, _
        SearchOrder:=xlByRows, _
        MatchCase:=False
       
       
       
       wshSheet2.Columns("H:M").Replace What:=i, Replacement:=i + 1, LookAt:=xlWhole, _
        SearchOrder:=xlByRows, MatchCase:=False
       
       Application.Run "Simple_aa"

 
   















       If wshSheet2.Range("O4").Value = "33" Then
           wshSheet2.Select
           wshSheet2.Range("P3:U3").Copy
           Sheets("3P1").Select
           Sheets("3P1").Cells(int3P1Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("3P1").Cells(int3P1Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P4:U4").Copy
           Sheets("3P1").Select
           Sheets("3P1").Cells(int3P1Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("3P1").Cells(int3P1Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P5:U5").Copy
           Sheets("3P1").Select
           Sheets("3P1").Cells(int3P1Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("3P1").Cells(int3P1Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P6:U6").Copy
           Sheets("3P1").Select
           Sheets("3P1").Cells(int3P1Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("3P1").Cells(int3P1Row, 37).Value = j 'Changed value in D column
           int3P1Row = int3P1Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
   
       If wshSheet2.Range("O11").Value = "33" Then
           wshSheet2.Select
           wshSheet2.Range("P10:U10").Copy
           Sheets("3P2").Select
           Sheets("3P2").Cells(int3P2Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("3P2").Cells(int3P2Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P11:U11").Copy
           Sheets("3P2").Select
           Sheets("3P2").Cells(int3P2Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("3P2").Cells(int3P2Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P12:U12").Copy
           Sheets("3P2").Select
           Sheets("3P2").Cells(int3P2Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("3P2").Cells(int3P2Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P13:U13").Copy
           Sheets("3P2").Select
           Sheets("3P2").Cells(int3P2Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("3P2").Cells(int3P2Row, 37).Value = j 'Changed value in D column
           int3P2Row = int3P2Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
 
       If wshSheet2.Range("O18").Value = "33" Then
           wshSheet2.Select
           wshSheet2.Range("P17:U17").Copy
           Sheets("3P3").Select
           Sheets("3P3").Cells(int3P3Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("3P3").Cells(int3P3Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P18:U18").Copy
           Sheets("3P3").Select
           Sheets("3P3").Cells(int3P3Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("3P3").Cells(int3P3Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P19:U19").Copy
           Sheets("3P3").Select
           Sheets("3P3").Cells(int3P3Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("3P3").Cells(int3P3Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P20:U20").Copy
           Sheets("3P3").Select
           Sheets("3P3").Cells(int3P3Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("3P3").Cells(int3P3Row, 37).Value = j 'Changed value in D column
           int3P3Row = int3P3Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
       If wshSheet2.Range("O25").Value = "33" Then
           wshSheet2.Select
           wshSheet2.Range("P24:U24").Copy
           Sheets("3P4").Select
           Sheets("3P4").Cells(int3P4Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("3P4").Cells(int3P4Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P25:U25").Copy
           Sheets("3P4").Select
           Sheets("3P4").Cells(int3P4Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("3P4").Cells(int3P4Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P26:U26").Copy
           Sheets("3P4").Select
           Sheets("3P4").Cells(int3P4Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("3P4").Cells(int3P4Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P27:U27").Copy
           Sheets("3P4").Select
           Sheets("3P4").Cells(int3P4Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("3P4").Cells(int3P4Row, 37).Value = j 'Changed value in D column
           int3P4Row = int3P4Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
       If wshSheet2.Range("O32").Value = "33" Then
           wshSheet2.Select
           wshSheet2.Range("P31:U31").Copy
           Sheets("3P5").Select
           Sheets("3P5").Cells(int3P5Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("3P5").Cells(int3P5Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P32:U32").Copy
           Sheets("3P5").Select
           Sheets("3P5").Cells(int3P5Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("3P5").Cells(int3P5Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P33:U33").Copy
           Sheets("3P5").Select
           Sheets("3P5").Cells(int3P5Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("3P5").Cells(int3P5Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P34:U34").Copy
           Sheets("3P5").Select
           Sheets("3P5").Cells(int3P5Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("3P5").Cells(int3P5Row, 37).Value = j 'Changed value in D column
           int3P5Row = int3P5Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("O39").Value = "33" Then
           wshSheet2.Select
           wshSheet2.Range("P38:U38").Copy
           Sheets("3P6").Select
           Sheets("3P6").Cells(int3P6Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("3P6").Cells(int3P6Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P39:U39").Copy
           Sheets("3P6").Select
           Sheets("3P6").Cells(int3P6Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("3P6").Cells(int3P6Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P40:U40").Copy
           Sheets("3P6").Select
           Sheets("3P6").Cells(int3P6Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("3P6").Cells(int3P6Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P41:U41").Copy
           Sheets("3P6").Select
           Sheets("3P6").Cells(int3P6Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("3P6").Cells(int3P6Row, 37).Value = j 'Changed value in D column
           int3P6Row = int3P6Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
       
       If wshSheet2.Range("X4").Value = "33" Then
           wshSheet2.Select
           wshSheet2.Range("Y3:AD3").Copy
           Sheets("3P7").Select
           Sheets("3P7").Cells(int3P7Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("3P7").Cells(int3P7Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y4:AD4").Copy
           Sheets("3P7").Select
           Sheets("3P7").Cells(int3P7Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("3P7").Cells(int3P7Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y5:AD5").Copy
           Sheets("3P7").Select
           Sheets("3P7").Cells(int3P7Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("3P7").Cells(int3P7Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y6:AD6").Copy
           Sheets("3P7").Select
           Sheets("3P7").Cells(int3P7Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("3P7").Cells(int3P7Row, 37).Value = j 'Changed value in D column
           int3P7Row = int3P7Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           

       End If
   
       If wshSheet2.Range("X11").Value = "33" Then
           wshSheet2.Select
           wshSheet2.Range("Y10:AD10").Copy
           Sheets("3P8").Select
           Sheets("3P8").Cells(int3P8Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("3P8").Cells(int3P8Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y11:AD11").Copy
           Sheets("3P8").Select
           Sheets("3P8").Cells(int3P8Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("3P8").Cells(int3P8Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y12:AD12").Copy
           Sheets("3P8").Select
           Sheets("3P8").Cells(int3P8Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("3P8").Cells(int3P8Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y13:AD13").Copy
           Sheets("3P8").Select
           Sheets("3P8").Cells(int3P8Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("3P8").Cells(int3P8Row, 37).Value = j 'Changed value in D column
           int3P8Row = int3P8Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
 
       If wshSheet2.Range("X18").Value = "33" Then
           wshSheet2.Select
           wshSheet2.Range("Y17:AD17").Copy
           Sheets("3P9").Select
           Sheets("3P9").Cells(int3P9Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("3P9").Cells(int3P9Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y18:AD18").Copy
           Sheets("3P9").Select
           Sheets("3P9").Cells(int3P9Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("3P9").Cells(int3P9Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y19:AD19").Copy
           Sheets("3P9").Select
           Sheets("3P9").Cells(int3P9Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("3P9").Cells(int3P9Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y20:AD20").Copy
           Sheets("3P9").Select
           Sheets("3P9").Cells(int3P9Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("3P9").Cells(int3P9Row, 37).Value = j 'Changed value in D column
           int3P9Row = int3P9Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("X25").Value = "33" Then
           wshSheet2.Select
           wshSheet2.Range("Y24:AD24").Copy
           Sheets("3P10").Select
           Sheets("3P10").Cells(int3P10Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("3P10").Cells(int3P10Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y25:AD25").Copy
           Sheets("3P10").Select
           Sheets("3P10").Cells(int3P10Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("3P10").Cells(int3P10Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y26:AD26").Copy
           Sheets("3P10").Select
           Sheets("3P10").Cells(int3P10Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("3P10").Cells(int3P10Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y27:AD27").Copy
           Sheets("3P10").Select
           Sheets("3P10").Cells(int3P10Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("3P10").Cells(int3P10Row, 37).Value = j 'Changed value in D column
           int3P10Row = int3P10Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("X32").Value = "33" Then
           wshSheet2.Select
           wshSheet2.Range("Y31:AD31").Copy
           Sheets("3P11").Select
           Sheets("3P11").Cells(int3P11Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("3P11").Cells(int3P11Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y32:AD32").Copy
           Sheets("3P11").Select
           Sheets("3P11").Cells(int3P11Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("3P11").Cells(int3P11Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y33:AD33").Copy
           Sheets("3P11").Select
           Sheets("3P11").Cells(int3P11Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("3P11").Cells(int3P11Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y34:AD34").Copy
           Sheets("3P11").Select
           Sheets("3P11").Cells(int3P11Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("3P11").Cells(int3P11Row, 37).Value = j 'Changed value in D column
           int3P11Row = int3P11Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           

       End If
 
       If wshSheet2.Range("X39").Value = "33" Then
           wshSheet2.Select
           wshSheet2.Range("Y38:AD38").Copy
           Sheets("3P12").Select
           Sheets("3P12").Cells(int3P12Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("3P12").Cells(int3P12Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y39:AD39").Copy
           Sheets("3P12").Select
           Sheets("3P12").Cells(int3P12Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("3P12").Cells(int3P12Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y40:AD40").Copy
           Sheets("3P12").Select
           Sheets("3P12").Cells(int3P12Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("3P12").Cells(int3P12Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y41:AD41").Copy
           Sheets("3P12").Select
           Sheets("3P12").Cells(int3P12Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("3P12").Cells(int3P12Row, 37).Value = j 'Changed value in D column
           int3P12Row = int3P12Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
       End If





























   
       If wshSheet2.Range("O5").Value = "44" Then
           wshSheet2.Select
           wshSheet2.Range("P3:U3").Copy
           Sheets("4P1").Select
           Sheets("4P1").Cells(int4P1Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("4P1").Cells(int4P1Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P4:U4").Copy
           Sheets("4P1").Select
           Sheets("4P1").Cells(int4P1Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("4P1").Cells(int4P1Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P5:U5").Copy
           Sheets("4P1").Select
           Sheets("4P1").Cells(int4P1Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("4P1").Cells(int4P1Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P6:U6").Copy
           Sheets("4P1").Select
           Sheets("4P1").Cells(int4P1Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("4P1").Cells(int4P1Row, 37).Value = j 'Changed value in D column
           int4P1Row = int4P1Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
   
       If wshSheet2.Range("O12").Value = "44" Then
           wshSheet2.Select
           wshSheet2.Range("P10:U10").Copy
           Sheets("4P2").Select
           Sheets("4P2").Cells(int4P2Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("4P2").Cells(int4P2Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P11:U11").Copy
           Sheets("4P2").Select
           Sheets("4P2").Cells(int4P2Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("4P2").Cells(int4P2Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P12:U12").Copy
           Sheets("4P2").Select
           Sheets("4P2").Cells(int4P2Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("4P2").Cells(int4P2Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P13:U13").Copy
           Sheets("4P2").Select
           Sheets("4P2").Cells(int4P2Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("4P2").Cells(int4P2Row, 37).Value = j 'Changed value in D column
           int4P2Row = int4P2Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
 
       If wshSheet2.Range("O19").Value = "44" Then
           wshSheet2.Select
           wshSheet2.Range("P17:U17").Copy
           Sheets("4P3").Select
           Sheets("4P3").Cells(int4P3Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("4P3").Cells(int4P3Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P18:U18").Copy
           Sheets("4P3").Select
           Sheets("4P3").Cells(int4P3Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("4P3").Cells(int4P3Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P19:U19").Copy
           Sheets("4P3").Select
           Sheets("4P3").Cells(int4P3Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("4P3").Cells(int4P3Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P20:U20").Copy
           Sheets("4P3").Select
           Sheets("4P3").Cells(int4P3Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("4P3").Cells(int4P3Row, 37).Value = j 'Changed value in D column
           int4P3Row = int4P3Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
       If wshSheet2.Range("O26").Value = "44" Then
           wshSheet2.Select
           wshSheet2.Range("P24:U24").Copy
           Sheets("4P4").Select
           Sheets("4P4").Cells(int4P4Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("4P4").Cells(int4P4Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P25:U25").Copy
           Sheets("4P4").Select
           Sheets("4P4").Cells(int4P4Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("4P4").Cells(int4P4Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P26:U26").Copy
           Sheets("4P4").Select
           Sheets("4P4").Cells(int4P4Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("4P4").Cells(int4P4Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P27:U27").Copy
           Sheets("4P4").Select
           Sheets("4P4").Cells(int4P4Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("4P4").Cells(int4P4Row, 37).Value = j 'Changed value in D column
           int4P4Row = int4P4Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
       If wshSheet2.Range("O33").Value = "44" Then
           wshSheet2.Select
           wshSheet2.Range("P31:U31").Copy
           Sheets("4P5").Select
           Sheets("4P5").Cells(int4P5Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("4P5").Cells(int4P5Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P32:U32").Copy
           Sheets("4P5").Select
           Sheets("4P5").Cells(int4P5Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("4P5").Cells(int4P5Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P33:U33").Copy
           Sheets("4P5").Select
           Sheets("4P5").Cells(int4P5Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("4P5").Cells(int4P5Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P34:U34").Copy
           Sheets("4P5").Select
           Sheets("4P5").Cells(int4P5Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("4P5").Cells(int4P5Row, 37).Value = j 'Changed value in D column
           int4P5Row = int4P5Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("O40").Value = "44" Then
           wshSheet2.Select
           wshSheet2.Range("P38:U38").Copy
           Sheets("4P6").Select
           Sheets("4P6").Cells(int4P6Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("4P6").Cells(int4P6Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P39:U39").Copy
           Sheets("4P6").Select
           Sheets("4P6").Cells(int4P6Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("4P6").Cells(int4P6Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P40:U40").Copy
           Sheets("4P6").Select
           Sheets("4P6").Cells(int4P6Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("4P6").Cells(int4P6Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P41:U41").Copy
           Sheets("4P6").Select
           Sheets("4P6").Cells(int4P6Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("4P6").Cells(int4P6Row, 37).Value = j 'Changed value in D column
           int4P6Row = int4P6Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
       
       If wshSheet2.Range("X5").Value = "44" Then
           wshSheet2.Select
           wshSheet2.Range("Y3:AD3").Copy
           Sheets("4P7").Select
           Sheets("4P7").Cells(int4P7Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("4P7").Cells(int4P7Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y4:AD4").Copy
           Sheets("4P7").Select
           Sheets("4P7").Cells(int4P7Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("4P7").Cells(int4P7Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y5:AD5").Copy
           Sheets("4P7").Select
           Sheets("4P7").Cells(int4P7Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("4P7").Cells(int4P7Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y6:AD6").Copy
           Sheets("4P7").Select
           Sheets("4P7").Cells(int4P7Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("4P7").Cells(int4P7Row, 37).Value = j 'Changed value in D column
           int4P7Row = int4P7Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           

       End If
   
       If wshSheet2.Range("X12").Value = "44" Then
           wshSheet2.Select
           wshSheet2.Range("Y10:AD10").Copy
           Sheets("4P8").Select
           Sheets("4P8").Cells(int4P8Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("4P8").Cells(int4P8Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y11:AD11").Copy
           Sheets("4P8").Select
           Sheets("4P8").Cells(int4P8Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("4P8").Cells(int4P8Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y12:AD12").Copy
           Sheets("4P8").Select
           Sheets("4P8").Cells(int4P8Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("4P8").Cells(int4P8Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y13:AD13").Copy
           Sheets("4P8").Select
           Sheets("4P8").Cells(int4P8Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("4P8").Cells(int4P8Row, 37).Value = j 'Changed value in D column
           int4P8Row = int4P8Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
 
       If wshSheet2.Range("X19").Value = "44" Then
           wshSheet2.Select
           wshSheet2.Range("Y17:AD17").Copy
           Sheets("4P9").Select
           Sheets("4P9").Cells(int4P9Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("4P9").Cells(int4P9Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y18:AD18").Copy
           Sheets("4P9").Select
           Sheets("4P9").Cells(int4P9Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("4P9").Cells(int4P9Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y19:AD19").Copy
           Sheets("4P9").Select
           Sheets("4P9").Cells(int4P9Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("4P9").Cells(int4P9Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y20:AD20").Copy
           Sheets("4P9").Select
           Sheets("4P9").Cells(int4P9Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("4P9").Cells(int4P9Row, 37).Value = j 'Changed value in D column
           int4P9Row = int4P9Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("X26").Value = "44" Then
           wshSheet2.Select
           wshSheet2.Range("Y24:AD24").Copy
           Sheets("4P10").Select
           Sheets("4P10").Cells(int4P10Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("4P10").Cells(int4P10Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y25:AD25").Copy
           Sheets("4P10").Select
           Sheets("4P10").Cells(int4P10Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("4P10").Cells(int4P10Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y26:AD26").Copy
           Sheets("4P10").Select
           Sheets("4P10").Cells(int4P10Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("4P10").Cells(int4P10Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y27:AD27").Copy
           Sheets("4P10").Select
           Sheets("4P10").Cells(int4P10Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("4P10").Cells(int4P10Row, 37).Value = j 'Changed value in D column
           int4P10Row = int4P10Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("X33").Value = "44" Then
           wshSheet2.Select
           wshSheet2.Range("Y31:AD31").Copy
           Sheets("4P11").Select
           Sheets("4P11").Cells(int4P11Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("4P11").Cells(int4P11Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y32:AD32").Copy
           Sheets("4P11").Select
           Sheets("4P11").Cells(int4P11Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("4P11").Cells(int4P11Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y33:AD33").Copy
           Sheets("4P11").Select
           Sheets("4P11").Cells(int4P11Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("4P11").Cells(int4P11Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y34:AD34").Copy
           Sheets("4P11").Select
           Sheets("4P11").Cells(int4P11Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("4P11").Cells(int4P11Row, 37).Value = j 'Changed value in D column
           int4P11Row = int4P11Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           

       End If
 
       If wshSheet2.Range("X40").Value = "44" Then
           wshSheet2.Select
           wshSheet2.Range("Y38:AD38").Copy
           Sheets("4P12").Select
           Sheets("4P12").Cells(int4P12Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("4P12").Cells(int4P12Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y39:AD39").Copy
           Sheets("4P12").Select
           Sheets("4P12").Cells(int4P12Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("4P12").Cells(int4P12Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y40:AD40").Copy
           Sheets("4P12").Select
           Sheets("4P12").Cells(int4P12Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("4P12").Cells(int4P12Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y41:AD41").Copy
           Sheets("4P12").Select
           Sheets("4P12").Cells(int4P12Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("4P12").Cells(int4P12Row, 37).Value = j 'Changed value in D column
           int4P12Row = int4P12Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If






























       If wshSheet2.Range("N3").Value = "55" Then
           wshSheet2.Select
           wshSheet2.Range("P3:U3").Copy
           Sheets("5P1").Select
           Sheets("5P1").Cells(int5P1Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("5P1").Cells(int5P1Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P4:U4").Copy
           Sheets("5P1").Select
           Sheets("5P1").Cells(int5P1Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("5P1").Cells(int5P1Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P5:U5").Copy
           Sheets("5P1").Select
           Sheets("5P1").Cells(int5P1Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("5P1").Cells(int5P1Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P6:U6").Copy
           Sheets("5P1").Select
           Sheets("5P1").Cells(int5P1Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("5P1").Cells(int5P1Row, 37).Value = j 'Changed value in D column
           int5P1Row = int5P1Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
   
       If wshSheet2.Range("N10").Value = "55" Then
           wshSheet2.Select
           wshSheet2.Range("P10:U10").Copy
           Sheets("5P2").Select
           Sheets("5P2").Cells(int5P2Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("5P2").Cells(int5P2Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P11:U11").Copy
           Sheets("5P2").Select
           Sheets("5P2").Cells(int5P2Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("5P2").Cells(int5P2Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P12:U12").Copy
           Sheets("5P2").Select
           Sheets("5P2").Cells(int5P2Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("5P2").Cells(int5P2Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P13:U13").Copy
           Sheets("5P2").Select
           Sheets("5P2").Cells(int5P2Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("5P2").Cells(int5P2Row, 37).Value = j 'Changed value in D column
           int5P2Row = int5P2Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
 
       If wshSheet2.Range("N17").Value = "55" Then
           wshSheet2.Select
           wshSheet2.Range("P17:U17").Copy
           Sheets("5P3").Select
           Sheets("5P3").Cells(int5P3Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("5P3").Cells(int5P3Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P18:U18").Copy
           Sheets("5P3").Select
           Sheets("5P3").Cells(int5P3Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("5P3").Cells(int5P3Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P19:U19").Copy
           Sheets("5P3").Select
           Sheets("5P3").Cells(int5P3Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("5P3").Cells(int5P3Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P20:U20").Copy
           Sheets("5P3").Select
           Sheets("5P3").Cells(int5P3Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("5P3").Cells(int5P3Row, 37).Value = j 'Changed value in D column
           int5P3Row = int5P3Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
       If wshSheet2.Range("N24").Value = "55" Then
           wshSheet2.Select
           wshSheet2.Range("P24:U24").Copy
           Sheets("5P4").Select
           Sheets("5P4").Cells(int5P4Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("5P4").Cells(int5P4Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P25:U25").Copy
           Sheets("5P4").Select
           Sheets("5P4").Cells(int5P4Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("5P4").Cells(int5P4Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P26:U26").Copy
           Sheets("5P4").Select
           Sheets("5P4").Cells(int5P4Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("5P4").Cells(int5P4Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P27:U27").Copy
           Sheets("5P4").Select
           Sheets("5P4").Cells(int5P4Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("5P4").Cells(int5P4Row, 37).Value = j 'Changed value in D column
           int5P4Row = int5P4Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
       If wshSheet2.Range("N31").Value = "55" Then
           wshSheet2.Select
           wshSheet2.Range("P31:U31").Copy
           Sheets("5P5").Select
           Sheets("5P5").Cells(int5P5Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("5P5").Cells(int5P5Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P32:U32").Copy
           Sheets("5P5").Select
           Sheets("5P5").Cells(int5P5Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("5P5").Cells(int5P5Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P33:U33").Copy
           Sheets("5P5").Select
           Sheets("5P5").Cells(int5P5Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("5P5").Cells(int5P5Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P34:U34").Copy
           Sheets("5P5").Select
           Sheets("5P5").Cells(int5P5Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("5P5").Cells(int5P5Row, 37).Value = j 'Changed value in D column
           int5P5Row = int5P5Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("N38").Value = "55" Then
           wshSheet2.Select
           wshSheet2.Range("P38:U38").Copy
           Sheets("5P6").Select
           Sheets("5P6").Cells(int5P6Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("5P6").Cells(int5P6Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P39:U39").Copy
           Sheets("5P6").Select
           Sheets("5P6").Cells(int5P6Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("5P6").Cells(int5P6Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P40:U40").Copy
           Sheets("5P6").Select
           Sheets("5P6").Cells(int5P6Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("5P6").Cells(int5P6Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P41:U41").Copy
           Sheets("5P6").Select
           Sheets("5P6").Cells(int5P6Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("5P6").Cells(int5P6Row, 37).Value = j 'Changed value in D column
           int5P6Row = int5P6Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
       
       If wshSheet2.Range("W3").Value = "55" Then
           wshSheet2.Select
           wshSheet2.Range("Y3:AD3").Copy
           Sheets("5P7").Select
           Sheets("5P7").Cells(int5P7Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("5P7").Cells(int5P7Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y4:AD4").Copy
           Sheets("5P7").Select
           Sheets("5P7").Cells(int5P7Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("5P7").Cells(int5P7Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y5:AD5").Copy
           Sheets("5P7").Select
           Sheets("5P7").Cells(int5P7Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("5P7").Cells(int5P7Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y6:AD6").Copy
           Sheets("5P7").Select
           Sheets("5P7").Cells(int5P7Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("5P7").Cells(int5P7Row, 37).Value = j 'Changed value in D column
           int5P7Row = int5P7Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           

       End If
   
       If wshSheet2.Range("W10").Value = "55" Then
           wshSheet2.Select
           wshSheet2.Range("Y10:AD10").Copy
           Sheets("5P8").Select
           Sheets("5P8").Cells(int5P8Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("5P8").Cells(int5P8Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y11:AD11").Copy
           Sheets("5P8").Select
           Sheets("5P8").Cells(int5P8Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("5P8").Cells(int5P8Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y12:AD12").Copy
           Sheets("5P8").Select
           Sheets("5P8").Cells(int5P8Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("5P8").Cells(int5P8Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y13:AD13").Copy
           Sheets("5P8").Select
           Sheets("5P8").Cells(int5P8Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("5P8").Cells(int5P8Row, 37).Value = j 'Changed value in D column
           int5P8Row = int5P8Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
 
       If wshSheet2.Range("W17").Value = "55" Then
           wshSheet2.Select
           wshSheet2.Range("Y17:AD17").Copy
           Sheets("5P9").Select
           Sheets("5P9").Cells(int5P9Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("5P9").Cells(int5P9Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y18:AD18").Copy
           Sheets("5P9").Select
           Sheets("5P9").Cells(int5P9Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("5P9").Cells(int5P9Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y19:AD19").Copy
           Sheets("5P9").Select
           Sheets("5P9").Cells(int5P9Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("5P9").Cells(int5P9Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y20:AD20").Copy
           Sheets("5P9").Select
           Sheets("5P9").Cells(int5P9Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("5P9").Cells(int5P9Row, 37).Value = j 'Changed value in D column
           int5P9Row = int5P9Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("W24").Value = "55" Then
           wshSheet2.Select
           wshSheet2.Range("Y24:AD24").Copy
           Sheets("5P10").Select
           Sheets("5P10").Cells(int5P10Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("5P10").Cells(int5P10Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y25:AD25").Copy
           Sheets("5P10").Select
           Sheets("5P10").Cells(int5P10Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("5P10").Cells(int5P10Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y26:AD26").Copy
           Sheets("5P10").Select
           Sheets("5P10").Cells(int5P10Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("5P10").Cells(int5P10Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y27:AD27").Copy
           Sheets("5P10").Select
           Sheets("5P10").Cells(int5P10Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("5P10").Cells(int5P10Row, 37).Value = j 'Changed value in D column
           int5P10Row = int5P10Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("W31").Value = "55" Then
           wshSheet2.Select
           wshSheet2.Range("Y31:AD31").Copy
           Sheets("5P11").Select
           Sheets("5P11").Cells(int5P11Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("5P11").Cells(int5P11Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y32:AD32").Copy
           Sheets("5P11").Select
           Sheets("5P11").Cells(int5P11Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("5P11").Cells(int5P11Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y33:AD33").Copy
           Sheets("5P11").Select
           Sheets("5P11").Cells(int5P11Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("5P11").Cells(int5P11Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y34:AD34").Copy
           Sheets("5P11").Select
           Sheets("5P11").Cells(int5P11Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("5P11").Cells(int5P11Row, 37).Value = j 'Changed value in D column
           int5P11Row = int5P11Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           

       End If
 
       If wshSheet2.Range("W38").Value = "55" Then
           wshSheet2.Select
           wshSheet2.Range("Y38:AD38").Copy
           Sheets("5P12").Select
           Sheets("5P12").Cells(int5P12Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("5P12").Cells(int5P12Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y39:AD39").Copy
           Sheets("5P12").Select
           Sheets("5P12").Cells(int5P12Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("5P12").Cells(int5P12Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y40:AD40").Copy
           Sheets("5P12").Select
           Sheets("5P12").Cells(int5P12Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("5P12").Cells(int5P12Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y41:AD41").Copy
           Sheets("5P12").Select
           Sheets("5P12").Cells(int5P12Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("5P12").Cells(int5P12Row, 37).Value = j 'Changed value in D column
           int5P12Row = int5P12Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           

       End If
































       If wshSheet2.Range("N4").Value = "66" Then
           wshSheet2.Select
           wshSheet2.Range("P3:U3").Copy
           Sheets("6P1").Select
           Sheets("6P1").Cells(int6P1Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("6P1").Cells(int6P1Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P4:U4").Copy
           Sheets("6P1").Select
           Sheets("6P1").Cells(int6P1Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("6P1").Cells(int6P1Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P5:U5").Copy
           Sheets("6P1").Select
           Sheets("6P1").Cells(int6P1Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("6P1").Cells(int6P1Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P6:U6").Copy
           Sheets("6P1").Select
           Sheets("6P1").Cells(int6P1Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("6P1").Cells(int6P1Row, 37).Value = j 'Changed value in D column
           int6P1Row = int6P1Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
   
       If wshSheet2.Range("N11").Value = "66" Then
           wshSheet2.Select
           wshSheet2.Range("P10:U10").Copy
           Sheets("6P2").Select
           Sheets("6P2").Cells(int6P2Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("6P2").Cells(int6P2Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P11:U11").Copy
           Sheets("6P2").Select
           Sheets("6P2").Cells(int6P2Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("6P2").Cells(int6P2Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P12:U12").Copy
           Sheets("6P2").Select
           Sheets("6P2").Cells(int6P2Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("6P2").Cells(int6P2Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P13:U13").Copy
           Sheets("6P2").Select
           Sheets("6P2").Cells(int6P2Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("6P2").Cells(int6P2Row, 37).Value = j 'Changed value in D column
           int6P2Row = int6P2Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
 
       If wshSheet2.Range("N18").Value = "66" Then
           wshSheet2.Select
           wshSheet2.Range("P17:U17").Copy
           Sheets("6P3").Select
           Sheets("6P3").Cells(int6P3Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("6P3").Cells(int6P3Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P18:U18").Copy
           Sheets("6P3").Select
           Sheets("6P3").Cells(int6P3Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("6P3").Cells(int6P3Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P19:U19").Copy
           Sheets("6P3").Select
           Sheets("6P3").Cells(int6P3Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("6P3").Cells(int6P3Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P20:U20").Copy
           Sheets("6P3").Select
           Sheets("6P3").Cells(int6P3Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("6P3").Cells(int6P3Row, 37).Value = j 'Changed value in D column
           int6P3Row = int6P3Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
       If wshSheet2.Range("N25").Value = "66" Then
           wshSheet2.Select
           wshSheet2.Range("P24:U24").Copy
           Sheets("6P4").Select
           Sheets("6P4").Cells(int6P4Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("6P4").Cells(int6P4Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P25:U25").Copy
           Sheets("6P4").Select
           Sheets("6P4").Cells(int6P4Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("6P4").Cells(int6P4Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P26:U26").Copy
           Sheets("6P4").Select
           Sheets("6P4").Cells(int6P4Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("6P4").Cells(int6P4Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P27:U27").Copy
           Sheets("6P4").Select
           Sheets("6P4").Cells(int6P4Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("6P4").Cells(int6P4Row, 37).Value = j 'Changed value in D column
           int6P4Row = int6P4Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
       If wshSheet2.Range("N32").Value = "66" Then
           wshSheet2.Select
           wshSheet2.Range("P31:U31").Copy
           Sheets("6P5").Select
           Sheets("6P5").Cells(int6P5Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("6P5").Cells(int6P5Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P32:U32").Copy
           Sheets("6P5").Select
           Sheets("6P5").Cells(int6P5Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("6P5").Cells(int6P5Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P33:U33").Copy
           Sheets("6P5").Select
           Sheets("6P5").Cells(int6P5Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("6P5").Cells(int6P5Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P34:U34").Copy
           Sheets("6P5").Select
           Sheets("6P5").Cells(int6P5Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("6P5").Cells(int6P5Row, 37).Value = j 'Changed value in D column
           int6P5Row = int6P5Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("N39").Value = "66" Then
           wshSheet2.Select
           wshSheet2.Range("P38:U38").Copy
           Sheets("6P6").Select
           Sheets("6P6").Cells(int6P6Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("6P6").Cells(int6P6Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P39:U39").Copy
           Sheets("6P6").Select
           Sheets("6P6").Cells(int6P6Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("6P6").Cells(int6P6Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P40:U40").Copy
           Sheets("6P6").Select
           Sheets("6P6").Cells(int6P6Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("6P6").Cells(int6P6Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P41:U41").Copy
           Sheets("6P6").Select
           Sheets("6P6").Cells(int6P6Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("6P6").Cells(int6P6Row, 37).Value = j 'Changed value in D column
           int6P6Row = int6P6Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
       
       If wshSheet2.Range("W4").Value = "66" Then
           wshSheet2.Select
           wshSheet2.Range("Y3:AD3").Copy
           Sheets("6P7").Select
           Sheets("6P7").Cells(int6P7Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("6P7").Cells(int6P7Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y4:AD4").Copy
           Sheets("6P7").Select
           Sheets("6P7").Cells(int6P7Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("6P7").Cells(int6P7Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y5:AD5").Copy
           Sheets("6P7").Select
           Sheets("6P7").Cells(int6P7Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("6P7").Cells(int6P7Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y6:AD6").Copy
           Sheets("6P7").Select
           Sheets("6P7").Cells(int6P7Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("6P7").Cells(int6P7Row, 37).Value = j 'Changed value in D column
           int6P7Row = int6P7Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           

       End If
   
       If wshSheet2.Range("W11").Value = "66" Then
           wshSheet2.Select
           wshSheet2.Range("Y10:AD10").Copy
           Sheets("6P8").Select
           Sheets("6P8").Cells(int6P8Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("6P8").Cells(int6P8Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y11:AD11").Copy
           Sheets("6P8").Select
           Sheets("6P8").Cells(int6P8Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("6P8").Cells(int6P8Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y12:AD12").Copy
           Sheets("6P8").Select
           Sheets("6P8").Cells(int6P8Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("6P8").Cells(int6P8Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y13:AD13").Copy
           Sheets("6P8").Select
           Sheets("6P8").Cells(int6P8Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("6P8").Cells(int6P8Row, 37).Value = j 'Changed value in D column
           int6P8Row = int6P8Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
 
       If wshSheet2.Range("W18").Value = "66" Then
           wshSheet2.Select
           wshSheet2.Range("Y17:AD17").Copy
           Sheets("6P9").Select
           Sheets("6P9").Cells(int6P9Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("6P9").Cells(int6P9Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y18:AD18").Copy
           Sheets("6P9").Select
           Sheets("6P9").Cells(int6P9Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("6P9").Cells(int6P9Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y19:AD19").Copy
           Sheets("6P9").Select
           Sheets("6P9").Cells(int6P9Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("6P9").Cells(int6P9Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y20:AD20").Copy
           Sheets("6P9").Select
           Sheets("6P9").Cells(int6P9Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("6P9").Cells(int6P9Row, 37).Value = j 'Changed value in D column
           int6P9Row = int6P9Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("W25").Value = "66" Then
           wshSheet2.Select
           wshSheet2.Range("Y24:AD24").Copy
           Sheets("6P10").Select
           Sheets("6P10").Cells(int6P10Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("6P10").Cells(int6P10Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y25:AD25").Copy
           Sheets("6P10").Select
           Sheets("6P10").Cells(int6P10Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("6P10").Cells(int6P10Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y26:AD26").Copy
           Sheets("6P10").Select
           Sheets("6P10").Cells(int6P10Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("6P10").Cells(int6P10Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y27:AD27").Copy
           Sheets("6P10").Select
           Sheets("6P10").Cells(int6P10Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("6P10").Cells(int6P10Row, 37).Value = j 'Changed value in D column
           int6P10Row = int6P10Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("W32").Value = "66" Then
           wshSheet2.Select
           wshSheet2.Range("Y31:AD31").Copy
           Sheets("6P11").Select
           Sheets("6P11").Cells(int6P11Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("6P11").Cells(int6P11Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y32:AD32").Copy
           Sheets("6P11").Select
           Sheets("6P11").Cells(int6P11Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("6P11").Cells(int6P11Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y33:AD33").Copy
           Sheets("6P11").Select
           Sheets("6P11").Cells(int6P11Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("6P11").Cells(int6P11Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y34:AD34").Copy
           Sheets("6P11").Select
           Sheets("6P11").Cells(int6P11Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("6P11").Cells(int6P11Row, 37).Value = j 'Changed value in D column
           int6P11Row = int6P11Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           

       End If
 
       If wshSheet2.Range("W39").Value = "66" Then
           wshSheet2.Select
           wshSheet2.Range("Y38:AD38").Copy
           Sheets("6P12").Select
           Sheets("6P12").Cells(int6P12Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("6P12").Cells(int6P12Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y39:AD39").Copy
           Sheets("6P12").Select
           Sheets("6P12").Cells(int6P12Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("6P12").Cells(int6P12Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y40:AD40").Copy
           Sheets("6P12").Select
           Sheets("6P12").Cells(int6P12Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("6P12").Cells(int6P12Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y41:AD41").Copy
           Sheets("6P12").Select
           Sheets("6P12").Cells(int6P12Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("6P12").Cells(int6P12Row, 37).Value = j 'Changed value in D column
           int6P12Row = int6P12Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
       End If
























   
       If wshSheet2.Range("N5").Value = "77" Then
           wshSheet2.Select
           wshSheet2.Range("P3:U3").Copy
           Sheets("7P1").Select
           Sheets("7P1").Cells(int7P1Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("7P1").Cells(int7P1Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P4:U4").Copy
           Sheets("7P1").Select
           Sheets("7P1").Cells(int7P1Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("7P1").Cells(int7P1Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P5:U5").Copy
           Sheets("7P1").Select
           Sheets("7P1").Cells(int7P1Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("7P1").Cells(int7P1Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P6:U6").Copy
           Sheets("7P1").Select
           Sheets("7P1").Cells(int7P1Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("7P1").Cells(int7P1Row, 37).Value = j 'Changed value in D column
           int7P1Row = int7P1Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
   
       If wshSheet2.Range("N12").Value = "77" Then
           wshSheet2.Select
           wshSheet2.Range("P10:U10").Copy
           Sheets("7P2").Select
           Sheets("7P2").Cells(int7P2Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("7P2").Cells(int7P2Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P11:U11").Copy
           Sheets("7P2").Select
           Sheets("7P2").Cells(int7P2Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("7P2").Cells(int7P2Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P12:U12").Copy
           Sheets("7P2").Select
           Sheets("7P2").Cells(int7P2Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("7P2").Cells(int7P2Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P13:U13").Copy
           Sheets("7P2").Select
           Sheets("7P2").Cells(int7P2Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("7P2").Cells(int7P2Row, 37).Value = j 'Changed value in D column
           int7P2Row = int7P2Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
 
       If wshSheet2.Range("N19").Value = "77" Then
           wshSheet2.Select
           wshSheet2.Range("P17:U17").Copy
           Sheets("7P3").Select
           Sheets("7P3").Cells(int7P3Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("7P3").Cells(int7P3Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P18:U18").Copy
           Sheets("7P3").Select
           Sheets("7P3").Cells(int7P3Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("7P3").Cells(int7P3Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P19:U19").Copy
           Sheets("7P3").Select
           Sheets("7P3").Cells(int7P3Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("7P3").Cells(int7P3Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
          wshSheet2.Select
           wshSheet2.Range("P20:U20").Copy
           Sheets("7P3").Select
           Sheets("7P3").Cells(int7P3Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("7P3").Cells(int7P3Row, 37).Value = j 'Changed value in D column
           int7P3Row = int7P3Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
       If wshSheet2.Range("N26").Value = "77" Then
           wshSheet2.Select
           wshSheet2.Range("P24:U24").Copy
           Sheets("7P4").Select
           Sheets("7P4").Cells(int7P4Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("7P4").Cells(int7P4Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P25:U25").Copy
           Sheets("7P4").Select
           Sheets("7P4").Cells(int7P4Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("7P4").Cells(int7P4Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P26:U26").Copy
           Sheets("7P4").Select
           Sheets("7P4").Cells(int7P4Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("7P4").Cells(int7P4Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P27:U27").Copy
           Sheets("7P4").Select
           Sheets("7P4").Cells(int7P4Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("7P4").Cells(int7P4Row, 37).Value = j 'Changed value in D column
           int7P4Row = int7P4Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
       End If
 
       If wshSheet2.Range("N33").Value = "77" Then
           wshSheet2.Select
           wshSheet2.Range("P31:U31").Copy
           Sheets("7P5").Select
           Sheets("7P5").Cells(int7P5Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("7P5").Cells(int7P5Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("P32:U32").Copy
           Sheets("7P5").Select
           Sheets("7P5").Cells(int7P5Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("7P5").Cells(int7P5Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P33:U33").Copy
           Sheets("7P5").Select
           Sheets("7P5").Cells(int7P5Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("7P5").Cells(int7P5Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P34:U34").Copy
           Sheets("7P5").Select
           Sheets("7P5").Cells(int7P5Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("7P5").Cells(int7P5Row, 37).Value = j 'Changed value in D column
           int7P5Row = int7P5Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("N40").Value = "77" Then
           wshSheet2.Select
           wshSheet2.Range("P38:U38").Copy
           Sheets("7P6").Select
           Sheets("7P6").Cells(int7P6Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("7P6").Cells(int7P6Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P39:U39").Copy
           Sheets("7P6").Select
           Sheets("7P6").Cells(int7P6Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("7P6").Cells(int7P6Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P40:U40").Copy
           Sheets("7P6").Select
           Sheets("7P6").Cells(int7P6Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("7P6").Cells(int7P6Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("P41:U41").Copy
           Sheets("7P6").Select
           Sheets("7P6").Cells(int7P6Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("7P6").Cells(int7P6Row, 37).Value = j 'Changed value in D column
           int7P6Row = int7P6Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
       
       If wshSheet2.Range("W5").Value = "77" Then
           wshSheet2.Select
           wshSheet2.Range("Y3:AD3").Copy
           Sheets("7P7").Select
           Sheets("7P7").Cells(int7P7Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("7P7").Cells(int7P7Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y4:AD4").Copy
           Sheets("7P7").Select
           Sheets("7P7").Cells(int7P7Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("7P7").Cells(int7P7Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y5:AD5").Copy
           Sheets("7P7").Select
           Sheets("7P7").Cells(int7P7Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("7P7").Cells(int7P7Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y6:AD6").Copy
           Sheets("7P7").Select
           Sheets("7P7").Cells(int7P7Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("7P7").Cells(int7P7Row, 37).Value = j 'Changed value in D column
           int7P7Row = int7P7Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           

       End If
   
       If wshSheet2.Range("W12").Value = "77" Then
           wshSheet2.Select
           wshSheet2.Range("Y10:AD10").Copy
           Sheets("7P8").Select
           Sheets("7P8").Cells(int7P8Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("7P8").Cells(int7P8Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y11:AD11").Copy
           Sheets("7P8").Select
           Sheets("7P8").Cells(int7P8Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("7P8").Cells(int7P8Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y12:AD12").Copy
           Sheets("7P8").Select
           Sheets("7P8").Cells(int7P8Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("7P8").Cells(int7P8Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y13:AD13").Copy
           Sheets("7P8").Select
           Sheets("7P8").Cells(int7P8Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("7P8").Cells(int7P8Row, 37).Value = j 'Changed value in D column
           int7P8Row = int7P8Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
 
       If wshSheet2.Range("W19").Value = "77" Then
           wshSheet2.Select
           wshSheet2.Range("Y17:AD17").Copy
           Sheets("7P9").Select
           Sheets("7P9").Cells(int7P9Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("7P9").Cells(int7P9Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y18:AD18").Copy
           Sheets("7P9").Select
           Sheets("7P9").Cells(int7P9Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("7P9").Cells(int7P9Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y19:AD19").Copy
           Sheets("7P9").Select
           Sheets("7P9").Cells(int7P9Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("7P9").Cells(int7P9Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y20:AD20").Copy
           Sheets("7P9").Select
           Sheets("7P9").Cells(int7P9Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("7P9").Cells(int7P9Row, 37).Value = j 'Changed value in D column
           int7P9Row = int7P9Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("W26").Value = "77" Then
           wshSheet2.Select
           wshSheet2.Range("Y24:AD24").Copy
           Sheets("7P10").Select
           Sheets("7P10").Cells(int7P10Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("7P10").Cells(int7P10Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y25:AD25").Copy
           Sheets("7P10").Select
           Sheets("7P10").Cells(int7P10Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("7P10").Cells(int7P10Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y26:AD26").Copy
           Sheets("7P10").Select
           Sheets("7P10").Cells(int7P10Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("7P10").Cells(int7P10Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y27:AD27").Copy
           Sheets("7P10").Select
           Sheets("7P10").Cells(int7P10Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("7P10").Cells(int7P10Row, 37).Value = j 'Changed value in D column
           int7P10Row = int7P10Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If
 
       If wshSheet2.Range("W33").Value = "77" Then
           wshSheet2.Select
           wshSheet2.Range("Y31:AD31").Copy
           Sheets("7P11").Select
           Sheets("7P11").Cells(int7P11Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("7P11").Cells(int7P11Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y32:AD32").Copy
           Sheets("7P11").Select
           Sheets("7P11").Cells(int7P11Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("7P11").Cells(int7P11Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y33:AD33").Copy
           Sheets("7P11").Select
           Sheets("7P11").Cells(int7P11Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("7P11").Cells(int7P11Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y34:AD34").Copy
           Sheets("7P11").Select
           Sheets("7P11").Cells(int7P11Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("7P11").Cells(int7P11Row, 37).Value = j 'Changed value in D column
           int7P11Row = int7P11Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           

       End If
 
       If wshSheet2.Range("W40").Value = "77" Then
           wshSheet2.Select
           wshSheet2.Range("Y38:AD38").Copy
           Sheets("7P12").Select
           Sheets("7P12").Cells(int7P12Row, 1).PasteSpecial Paste:=xlPasteValues
           Sheets("7P12").Cells(int7P12Row, 7).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select

           wshSheet2.Select
           wshSheet2.Range("Y39:AD39").Copy
           Sheets("7P12").Select
           Sheets("7P12").Cells(int7P12Row, 11).PasteSpecial Paste:=xlPasteValues
           Sheets("7P12").Cells(int7P12Row, 17).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y40:AD40").Copy
           Sheets("7P12").Select
           Sheets("7P12").Cells(int7P12Row, 21).PasteSpecial Paste:=xlPasteValues
           Sheets("7P12").Cells(int7P12Row, 27).Value = j 'Changed value in D column
           Application.CutCopyMode = False
           Sheets("Sheet2").Select
           
           wshSheet2.Select
           wshSheet2.Range("Y41:AD41").Copy
           Sheets("7P12").Select
           Sheets("7P12").Cells(int7P12Row, 31).PasteSpecial Paste:=xlPasteValues
           Sheets("7P12").Cells(int7P12Row, 37).Value = j 'Changed value in D column
           int7P12Row = int7P12Row + 1
           Application.CutCopyMode = False
           Sheets("Sheet2").Select


       End If



































   Next i
   
End Sub
0
 
LVL 1

Expert Comment

by:duoba
ID: 8100527
just make the variables global

outside of the functions declare the variables as

public i as long
0
 
LVL 9

Expert Comment

by:pauloaguia
ID: 8105307
ykes... it is large indeed. But I can see some repetitions on it. I'll take a closer look into it and get back to you in a while (better wait sitting :))
0
 
LVL 9

Accepted Solution

by:
pauloaguia earned 100 total points
ID: 8105601
OK, I'm back.

I haven't gone trough all your code thouroughly. I ate reviewing my own let alone other people's code. But I managed to find a pattern. You're basically repeating the same operation over and over again just over different cells.

I didn't try to understand what you're doing. I don't know enough of your document's structure to do that. But I noticed that, all those big IF's can be grouped in 6. And replaced by this code

--
      For k = 0 To 5
          If wshSheet2.Range("O" & k * 7 + 4).Value = "33" Then
              wshSheet2.Select
              wshSheet2.Range("P" & k * 7 + 3 & ":U" & k * 7 + 3).Copy
              Sheets("3P" & k + 1).Select
              Sheets("3P" & k + 1).Cells(intPRow(3, k + 1), 1).PasteSpecial Paste:=xlPasteValues
              Sheets("3P" & k + 1).Cells(intPRow(3, k + 1), 7).Value = j 'Changed value in D column
              Application.CutCopyMode = False
              Sheets("Sheet2").Select
             
              wshSheet2.Select
              wshSheet2.Range("P" & k * 7 + 4 & ":U" & k * 7 + 4).Copy
              Sheets("3P" & k + 1).Select
              Sheets("3P" & k + 1).Cells(intPRow(3, k + 1), 11).PasteSpecial Paste:=xlPasteValues
              Sheets("3P" & k + 1).Cells(intPRow(3, k + 1), 17).Value = j 'Changed value in D column
              Application.CutCopyMode = False
              Sheets("Sheet2").Select
   
              wshSheet2.Select
              wshSheet2.Range("P" & k * 7 + 5 & ":U" & k * 7 + 5).Copy
              Sheets("3P" & k + 1).Select
              Sheets("3P" & k + 1).Cells(intPRow(3, k + 1), 21).PasteSpecial Paste:=xlPasteValues
              Sheets("3P" & k + 1).Cells(intPRow(3, k + 1), 27).Value = j 'Changed value in D column
              Application.CutCopyMode = False
              Sheets("Sheet2").Select
   
              wshSheet2.Select
              wshSheet2.Range("P" & k * 7 + 6 & ":U" & k * 7 + 6).Copy
              Sheets("3P" & k + 1).Select
              Sheets("3P" & k + 1).Cells(intPRow(3, k + 1), 31).PasteSpecial Paste:=xlPasteValues
              Sheets("3P" & k + 1).Cells(intPRow(3, k + 1), 37).Value = j 'Changed value in D column
              intPRow(3, k + 1) = intPRow(3, k + 1) + 1
              Application.CutCopyMode = False
              Sheets("Sheet2").Select
          End If
        Next
--

You'll note that references as O4, O11, O18, etc have been replaced by O(k*7+4). And all through the following lines. I also replaced all your variables intKPNRow with an array declared and initialized as follows:

--
  Dim intPRow(3 To 7, 1 To 12)        As Integer
  For j = 3 To 7
    For i = 1 To 12
      intPRow(j, i) = 2
    Next
  Next
--

This should decrease the size quite a bit.

It's still my strong conviction that the rest of the code is quite similar and could be automated too. I just need to find some pattern there but I'm sure you can do that better than me.

Hope this helps

Paulo
0
 

Author Comment

by:gillesdiva
ID: 8125576
greeat, thanx for the help
0
 
LVL 9

Expert Comment

by:pauloaguia
ID: 8126442
Glad to help. Thanks for the points. By the way, next time you may consider giving more points for a task of this magnitude.

Paulo
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

766 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question