So, I want to write into range of cells based on information read from the sheet cells. I have uploaded a mini-sheet and code below to show what I have going. The goal is to get below output
startVal = 63 (Value in B3)
length = 4 (Value in B4)
=PrintData(Sheet!$B$3,Sheet1!$B$4,"Sheet1!$B$7") this formula in B7, ideally in B6
output should be :
63
64
65
66
Public Function PrintData(a, b As Range, c As String) As String
StartValue = CInt(a.Value)
Length = CInt(b.Value)
outRange = Range(c)
PrintData = CStr(StartValue) 'this should fill outRange(1,1).Value)
For i = 2 To Length
outRange(i, 1).Value = CStr(StartValue + i) ' some data in place of data from POST RestApi
Next
End Function
startVal = 63 (Value in B3)
length = 4 (Value in B4)
=PrintData(Sheet!$B$3,Sheet1!$B$4,"Sheet1!$B$7") this formula in B7, ideally in B6
output should be :
63
64
65
66
Public Function PrintData(a, b As Range, c As String) As String
StartValue = CInt(a.Value)
Length = CInt(b.Value)
outRange = Range(c)
PrintData = CStr(StartValue) 'this should fill outRange(1,1).Value)
For i = 2 To Length
outRange(i, 1).Value = CStr(StartValue + i) ' some data in place of data from POST RestApi
Next
End Function