Forum Discussion
Lorenzo Kim
Jun 09, 2018Bronze Contributor
how to write function or subroutine
I have a routine changing background and font of headers (shade of green, red and blue) and it keeps using the codes below. The 3 bold-italic are the ones that are changing, the rest are constant. C...
Man Fai Chan
Jun 09, 2018Iron Contributor
I am not sure that it should be a function.
When using function, there should be "as variant/long" at the first statement of the function. This determine the type of variable return.
You may just use
Sub Header_Color (ptc as variant, pts as long, fts as long)
and then use
Call Header_Color (xlThemeColorAccent6 ,-0.499984740745262,0.799981688894314)
in your main program.
Lorenzo Kim
Jun 09, 2018Bronze Contributor
Mr Chan
Thank you for your reply.
You are very helpful.
many many thanks