Application.ScreenUpdating = False For xc = 2 To 5 For yc = 351 To 396 digo = yc - 240 + (xc - 2) * 46 logg.Cells(yc - 340 + (xc - 2) * 46, 1).FormulaR1C1 = "='R:\Manufacture\Production\Mixing\details\Line\[Line_setup.xlsx]1'!R" & Mid(Str(digo), 2, Len(Str(digo)) - 1) & "C1" logg.Cells(yc - 340 + (xc - 2) * 46, 1) = logg.Cells(yc - 340 + (xc - 2) * 46, 1).Value If logg.Cells(yc - 340 + (xc - 2) * 46, 1) = 0 Then logg.Cells(yc - 340 + (xc - 2) * 46, 1) = "" logg.Cells(yc - 340, 100).FormulaR1C1 = "='R:\Manufacture\Production\Mixing\details\Line\[Line_setup.xlsx]1'!R" & Mid(Str(yc - 349), 2, Len(Str(yc - 349)) - 1) & "C7" logg.Cells(yc - 340, 100) = logg.Cells(yc - 340, 100).Value If logg.Cells(yc - 340, 100) = 0 Then logg.Cells(yc - 340, 100) = "" ' If yc < 385 Then logg.Cells(yc, xc).FormulaR1C1 = "='R:\Manufacture\Production\Mixing\details\Line\[Line_setup.xlsx]1'!R" & Mid(Str(yc - 347), 2, Len(Str(yc - 347)) - 1) & "C" & Chr(xc + 47) If logg.Cells(yc, xc) = 0 Then logg.Cells(yc, xc) = "" ' End If Next yc, xc logg.Activate 'Sheets("Log") Range("B351:E392").Select Selection.Copy Range("B351").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False