Since no one is asswering my question, may be people do not understand it. Let me give more example.
Usually, we use a fixed number of parameters/inputs or a range for a UDF. Example: Function xyz(a as double, b as double) as double xyz = a + b End Function Or Function xyz(rng as range) as double for each cell in rng xyz = xyz + cell next End Function But how can I have a function that allows users to select any number of parameters like the SUM function? In a SUM function, users can select multiple cells and ranges. As a programmer, we do not know how many they willl select into the function. How can we code such a function? -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our Facebook Group @ http://www.facebook.com/group.php?gid=287779555678 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,800 subscribers worldwide and receive many nice notes about the learning and support from the group.Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe