I'm wondering if it is possible to write values to a cell in Excel via a VBA Function?
Aka neither line in the following function will call:
Function OffsetValue(myinput As Double) As Double
ThisWorkbook.Sheets("Sheet1").Cells(1, 1).Value = myinput
Call OffsetValueSub(myinput)
End Function
Sub OffsetValueSub(myinput As Double)
ThisWorkbook.Sheets("Sheet1").Cells(1, 1).Value = myinput
End Sub
But The following Dummy Sub will work correctly:
Sub Dummy()
Call OffsetValueSub(100)
End Sub
Sub OffsetValueSub(myinput As Double)
ThisWorkbook.Sheets("Sheet1").Cells(1, 1).Value = myinput
End Sub
Is there something one has to do to be able to write to a cell which is not the cell which is calling the specific function?