Forum Discussion

Lukie_Dukie's avatar
Lukie_Dukie
Copper Contributor
Apr 23, 2020
Solved

Why does copying cells work in a Sub but not in a Function?

Hello,   I am new to VBA and have come across a problem: why does copying values from one cell to another work in a Sub but not in a Function?   I have simplified the problem to this description ...
  • Riny_van_Eekelen's avatar
    Apr 23, 2020

    Lukie_Dukie I guess that's because a function works inside a cell. Just like you can't put e.g. =SUM(A1:A10) in cell A11 and have the result returned in B11. But, with a SUB you can say "sum  A1:A10 and put the result somewhere else".