snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
วิธีสร้างข้อความคำอธิบาย Fuction ที่เราสร้าง ทำอย่างไรครับ
ตัวอย่างเช่น ถ้าเราพิมพ์ =sum มันจะมีคำอธิบายว่าใช้อย่างไร "add all numbers in a range of cells"
Sub DescribeFunction()
Dim FuncName As String
Dim FuncDesc As String
Dim FuncCat As Long
Dim Arg1Desc As String, Arg2Desc As String
FuncName = "DrawOne"
FuncDesc = "Displays the contents of a random cell from a range"
FuncCat = 5 'Lookup & Reference
Arg1Desc = "The range that contains the values"
Arg2Desc = "(Optional) If False or missing, a new cell is not "
Arg2Desc = Arg2Desc & "selected when recalculated. If True, a "
Arg2Desc = Arg2Desc & "new cell is selected when recalculated."
Application.MacroOptions _
Macro:=FuncName, _
Description:=FuncDesc, _
Category:=FuncCat, _
ArgumentDescriptions:=Array(Arg1Desc, Arg2Desc)
End Sub