Hi everyone,
I'm a newbie at VBA and I'm trying to get the hang of it. I have to learn how to do the following in preparation of an upcoming exam:
1. Write a function which takes in an input n and outputs the nth odd number
2. Write a function which takes in a number and outputs its factorial
3. Write a macro which takes an input value from cell a1 and changes the font color of column b
4. Write a macro that takes the range values as a string such as "a1:a15" and sums all the values
While I'm pretty comfortable with Excel and recording macros in general, coding in VBA is uncharted territory for me and I'm not sure I understand all the syntax (think they could've made it simpler, to be honest!)
Can anyone help me with the above 4 tasks? It would of course be of no use if I didn't learn from it, so if possible, please take some time out and explain to me why a particular syntax has been used and which piece of code does what. This way, I can try my own hand at it and see how it goes.
Cheers
Usama