Hi all,
ok trying to get the value of a cell from another spreadsheet and getting an error.
"
ok trying to get the value of a cell from another spreadsheet and getting an error.
VBA Code:
Sheets("Sheet1").Select
Range("B5").Select
Selection.End(xlToRight).Select ' could be 10 to 20 columns
ActiveCell.Offset(1000000, -1).Select
Selection.End(xlDown).Select
Selection.End(xlUp).Select ' possible max row 1000
GrandTotal = ActiveCell.Address '~~~~~~~~~ This gives the cell address as it is dynamic for both its row and column, e.g. cell address "O279"
Rowid = ActiveCell.Row ' Current Row for Cell
ColId = ActiveCell.Column ' Current Col for cell
Row = Rowid - 1 ' Adjustment for formula
Col = ColId - 1 ' Adjustment for formula
Sheets("Sheet2").Select
Range("D5").Select
'Trying to add the formula to bring back the value, but cannot get the following to work, need it to be a formula rather than just the value which I can do.
' ActiveCell.Formula = "=SUM('Sheet1'! & GrandTotal &)"
'ActiveCell.FormulaR1C1 = "='Sheet1'!R[" & Row & "]" & "C[" & Col
'ActiveCell.FormulaR1C1 = "=SUM('Sheet1'!R[Row]C[Col])"