Thread: functions
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Kanaski79 Kanaski79 is offline
external usenet poster
 
Posts: 4
Default functions

Ok this may sound like s stupid question. Where do you enter all this code?
I do have some programming experience but I have never written anything for
excell. Never needed to untill now. Small example would be greatly helpfull.

Thanks again

Kevin

"Vacation's Over" wrote:

User defined functions:
Create your own function simply by using Function instead of Sub. Then set
your function = value you require

Function MergeCount(Cellref as range) as Integer

Mergecount = Range("A4").MergeArea.Cells.Count

End Function

then in a cell
= MergeCount(A5)

"Kanaski79" wrote:

Don't know if you saw my other post, but it was about finding out how many
cells a merged cell group occupies. I need that number from the macro that
someone responded with to use that as the range for the lookup and max
functions. Do you think that would work?

this was the macro they gave me.

Sub test()
ActiveCell.Value = Format(Date, "dd-mmm-yyyy")
End Sub

Thanks

Kevin

"Vacation's Over" wrote:

If you convert your macro to a function then a function can call another
function.

Although there are many exceptions: a macro does something and a function
returns a value. So a function looking for information would be expected to
call another function.

"Kanaski79" wrote:

Can a Function call a macro? Say during a sort or lookup opperation you want
some special data that the macro returns?

Kevin