Description of Excel VBA function

%3CLINGO-SUB%20id%3D%22lingo-sub-3068346%22%20slang%3D%22en-US%22%3EDescription%20of%20Excel%20VBA%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3068346%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHi%2C%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3ECan%20anyone%20please%20tell%20me%20how%20can%20we%20assign%20description%20to%20excel%20VBA%20function%3F%20For%20example%20when%20we%20type%20Average%20it%20shows%20it's%20description%20as%20shown%20in%20figure%20below.%20I%20want%20to%20do%20the%20same%20with%20my%20custom%20VBA%20function.%20Thanks.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22256887094_139097838464545_3614446427764683541_n.jpg%22%20style%3D%22width%3A%20376px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F341438i528E846A043B5A9E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22256887094_139097838464545_3614446427764683541_n.jpg%22%20alt%3D%22256887094_139097838464545_3614446427764683541_n.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3068346%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3068358%22%20slang%3D%22en-US%22%3ERe%3A%20Description%20of%20Excel%20VBA%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3068358%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1282867%22%20target%3D%22_blank%22%3E%40mikhanx1%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3Ehere%20is%20a%20link%20with%20an%20average%20example%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fstackoverflow.com%2Fquestions%2F29800992%2Faverage-in-vba-in-excel%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EAverage%20in%20VBA%20in%20Excel%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EDim%20myRange%20as%20Range%0A%0A'Loop%20code%20here%0ASet%20myRange%20%3D%20Range(%22L%22%20%26amp%3B%20i%20%26amp%3B%20%22%3AL%22%20%26amp%3B%20k)%0ACells(j%2C%2020).Value%20%3D%20Application.WorksheetFunction.Average(myRange)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20I%20was%20able%20to%20help%20you%20with%20this%20info.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexcel-blog%2Fmeet-niko-chatzoudis-excel-forum-contributor%2Fba-p%2F2941385%22%20target%3D%22_blank%22%3ENikolinoDE%3C%2FA%3E%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi,
Can anyone please tell me how can we assign description to excel VBA function? For example when we type Average it shows it's description as shown in figure below. I want to do the same with my custom VBA function. Thanks.

256887094_139097838464545_3614446427764683541_n.jpg

5 Replies

@mikhanx1 

here is a link with an average example

Average in VBA in Excel

 

Dim myRange as Range

'Loop code here
Set myRange = Range("L" & i & ":L" & k)
Cells(j, 20).Value = Application.WorksheetFunction.Average(myRange)

 

 

Hope I was able to help you with this info.

 

NikolinoDE

I know I don't know anything (Socrates)

 

@mikhanx1 

Not exactly what you asked, but:

Let's say you create a UDF named MyFunc

Type =MyFunc( and then press Ctrl+Shift+A.

Result:

S1079.png

You can double-click an argument and then enter something or point to a range.

Wish I could give you more than 1 Like, I never knew this trick!!! TY. unfortunately, since I generally don't use UDFs, I'll probably forget about it then next time it would help

Thank you so much.

Thank you so much.