you are correct. You also need end function instead of end sub. You also have to declare any variables in the parenthesis.
Here is an example of a VERY boring and basic macro:
Sub Macro1()
Range("A1").Select
With Selection.Interior
.ColorIndex = 10
.Pattern = xlSolid
End With
End Sub
To make it to a function, I realize I need to change the word sub to function wherever applicable.
What I don't understand is what needs to be in the parentheses.
Thanks again!
Jen
This macro cannot be made into a function.
Functions cannot change cells. They can only return results.
So if I understand your response, Celia, I can only write functions that involve actual calculations?
If I want to change formatting based on values in certain cells (I realize the simple macro above doesn't test for values), I HAVE to use a macro?
Thanks for clarifying!
Jen
That's right. Have a look also at :-
MS Knowledge Base - article Q213199
and
http://www.cpearson.com/excel/differen.htm