VBA I have trouble calling a range that is on another page of my book


I wanted to do it in the following way:

Selection.FormulaR1C1 = Application.Goto (ActiveWorkbook.Sheets ("TRANSFERS"). Range ("RangePara"))

What I want is that the selection that I currently have is with the values of the dynamic range that I create in the sheet transfers called "RangePara".

The complete code would be:

    Range("A1").End(xlDown).Offset(500, 0).Select
    ActiveCell.Value = "PARA"

   ActiveCell.Offset(1, 0).Select
    Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(500, 0)).Select
     Selection.FormulaR1C1 = 
asked by ElTrapo 23.11.2018 в 17:39

1 answer


Welcome to SO in Spanish.

To take a value from one range to another, it is worth doing something in plan RangoDestino.Value=RangoOrigen.Value . And the Select is not necessary. So your code would stay in:

With Sheets("INVENTARIO")
    .Range("A1").End(xlDown).Offset(500, 0).Value = "PARA"
    .Range(Range("A1").End(xlDown).Offset(6, 0), Range("A1").End(xlDown).Offset(506, 0)).Value = ActiveWorkbook.Sheets("TRASLADOS").Range("RangePara").Value
End With
answered by 24.11.2018 в 00:03