Hi Guys,

I need help completing this code.

In the following code I would like to change these red "x"s into something valid but the idea should be clear if you go through the code. What I want to do here is copy certain cells (B2 and I2) from other files into respective rows:

______Col1_____Col2__________Col3
ROW2: Name1___B2 from file1___I2 from file1
ROW3: Name2___B2 from file2___I2 from file2



 FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
 
 For x = 2 To FinalRow

    
    p = Cells(1, 1).Value
    fl = Cells(x, 1).Value

      Workbooks.OpenText Filename:= _
        "" & pth & "\" & fl & "\Period Values.xlsm" _
  
      Range("B2").Select
    Selection.Copy
    Application.WindowState = xlMinimized
    Windows("tabulating period values").Activate
    Range("Bx").Select
    ActiveSheet.Paste
    Windows("Period Values.xlsm").Activate
    Range("I2").Select
    Application.CutCopyMode = False
    Selection.Copy
    Windows("tabulating period values").Activate
    Range("Cx").Select
    ActiveSheet.Paste
    Workbooks("Period Values.xlsm").Close False
  
  Next x
End Sub
I hope I have made myself clear enough, any help would be much appreciated.


Cheers.