Title says it all. Can you?
A function cannot modify a worksheet but a subroutine can. So can you call a subroutine from a function to modify a range of cells?
Title says it all. Can you?
A function cannot modify a worksheet but a subroutine can. So can you call a subroutine from a function to modify a range of cells?
Assuming you are refering to VBA functions and subs: not sure where you told that a function cannot modify a worksheet. They can and I have some that do. It is probably not a good practice to do that, but ...Originally Posted by thepr1nter
Functions can call subs or anything else. I have numerous functions that call subs which call other functions, etc. There may be a practical limit to "things calling things", but I have never encountered it.
"It's not just the due date that's important, it's also the do date" [MWE]
When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.
You can Call a Sub, but you still cannot modify the worksheet if the Function is called from a cell. If the Function is called from a Sub then you have more options.
Of course you can, but if you try and modify the worksheet in a sub called from a function invoked within the worksheet it will fail.Originally Posted by thepr1nter
You don't get around it that easily <vbg>.
.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Hi thepr1nter, thanks for stopping back
While you can call a sub from a function, you still can't manipulate a worksheet from a worksheet function calling a sub even if that sub has the actual code.
Sorry
Matt