{"id":857,"date":"2021-02-09T18:23:16","date_gmt":"2021-02-09T18:23:16","guid":{"rendered":"http:\/\/99excel.com\/home\/?p=857"},"modified":"2021-05-14T16:07:53","modified_gmt":"2021-05-14T16:07:53","slug":"excel-add-in","status":"publish","type":"post","link":"https:\/\/99excel.com\/home\/excel-add-in\/","title":{"rendered":"Create and Install an Excel Add-in from VBA -Tutorial"},"content":{"rendered":"\n<p>In this video, you will learn how to create and install an Excel add-ins from VBA. Simple copy and paste below code in your VBA project in any module and save it add-ins file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em>Option Explicit\n\nFunction TAXSLAB(TAXABLEINCOME As String)\nIf TAXABLEINCOME &lt;= 250000 And TAXABLEINCOME &gt; 0 Then\nTAXSLAB = 0\nElseIf TAXABLEINCOME &lt;= 500000 Then\nTAXSLAB = 5.2\nElseIf TAXABLEINCOME &lt;= 1000000 Then\nTAXSLAB = 20.8\nElseIf TAXABLEINCOME &lt;= 5000000 Then\nTAXSLAB = 31.2\nElseIf TAXABLEINCOME &lt;= 10000000 Then\nTAXSLAB = 34.32\nElseIf TAXABLEINCOME &lt;= 20000000 Then\nTAXSLAB = 35.88\nElseIf TAXABLEINCOME &lt;= 50000000 Then\nTAXSLAB = 39\nElse\nTAXSLAB = 42.74\nEnd If\nEnd Function\n\n      Function N2W(ByVal MyNumber)\n          Dim Dollars, Cents, Temp\n          Dim DecimalPlace, Count\n          ReDim Place(9) As String\n          Place(2) = \" Thousand \"\n          Place(3) = \" Lacs \"\n          Place(4) = \" Crores \"\n          Place(5) = \" Arabs \"\n          Place(6) = \" Kharabs \"\n\n          MyNumber = Trim(Str(MyNumber))\n          DecimalPlace = InStr(MyNumber, \".\")\n          If DecimalPlace &gt; 0 Then\n              Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) &amp; \"00\", 2))\n              MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))\n          End If\n          Count = 1\n          Do While MyNumber &lt;&gt; \"\"\n              If Count = 1 Then\n                Temp = GetHundreds(Right(MyNumber, 3))\n                If Temp &lt;&gt; \"\" Then Dollars = Temp &amp; Place(Count) &amp; Dollars\n                If Len(MyNumber) &gt; 3 Then\n                    MyNumber = Left(MyNumber, Len(MyNumber) - 3)\n                Else\n                    MyNumber = \"\"\n                End If\n              Else\n                If Len(MyNumber) &gt; 1 Then\n                    Temp = GetTens(Right(MyNumber, 2))\n                Else\n                    Temp = GetDigit(Right(MyNumber, 1))\n                End If\n                If Temp &lt;&gt; \"\" Then Dollars = Temp &amp; Place(Count) &amp; Dollars\n                If Len(MyNumber) &gt; 2 Then\n                    MyNumber = Left(MyNumber, Len(MyNumber) - 2)\n                Else\n                    MyNumber = \"\"\n                End If\n              End If\n              Count = Count + 1\n          Loop\n\n          Select Case Dollars\n              Case \"\"\n                  Dollars = \"No Rupees\"\n              Case \"One\"\n                  Dollars = \"One Rupee\"\n              Case Else\n                  Dollars = Dollars '&amp; \" Rupees\"\n          End Select\n\n          Select Case Cents\n              Case \"\"\n                  Cents = \"\"\n              Case \"One\"\n                  Cents = \" and One Paisa\"\n              Case Else\n                  Cents = \" and \" &amp; Cents &amp; \" Paise\"\n          End Select\n          N2W = Dollars &amp; Cents &amp; \" Only\"\n      End Function\n\n      '*******************************************\n      ' Converts a number from 100-999 into text *\n      '*******************************************\n      Function GetHundreds(ByVal MyNumber)\n          Dim Result As String\n          If Val(MyNumber) = 0 Then Exit Function\n          MyNumber = Right(\"000\" &amp; MyNumber, 3)\n          ' Convert the hundreds place.\n          If Mid(MyNumber, 1, 1) &lt;&gt; \"0\" Then\n              Result = GetDigit(Mid(MyNumber, 1, 1)) &amp; \" Hundred \"\n          End If\n          ' Convert the tens and ones place.\n          If Mid(MyNumber, 2, 1) &lt;&gt; \"0\" Then\n              Result = Result &amp; GetTens(Mid(MyNumber, 2))\n          Else\n              Result = Result &amp; GetDigit(Mid(MyNumber, 3))\n          End If\n          GetHundreds = Result\n      End Function\n\n      '*********************************************\n      ' Converts a number from 10 to 99 into text. *\n      '*********************************************\n     Function GetTens(TensText)\n          Dim Result As String\n          Result = \"\"           ' Null out the temporary function value.\n          If Val(Left(TensText, 1)) = 1 Then   ' If value between 10-19...\n              Select Case Val(TensText)\n                  Case 10: Result = \"Ten\"\n                  Case 11: Result = \"Eleven\"\n                  Case 12: Result = \"Twelve\"\n                  Case 13: Result = \"Thirteen\"\n                  Case 14: Result = \"Fourteen\"\n                  Case 15: Result = \"Fifteen\"\n                  Case 16: Result = \"Sixteen\"\n                  Case 17: Result = \"Seventeen\"\n                  Case 18: Result = \"Eighteen\"\n                  Case 19: Result = \"Nineteen\"\n                  Case Else\n              End Select\n          Else                                 ' If value between 20-99...\n              Select Case Val(Left(TensText, 1))\n                  Case 2: Result = \"Twenty \"\n                  Case 3: Result = \"Thirty \"\n                  Case 4: Result = \"Forty \"\n                  Case 5: Result = \"Fifty \"\n                  Case 6: Result = \"Sixty \"\n                  Case 7: Result = \"Seventy \"\n                  Case 8: Result = \"Eighty \"\n                  Case 9: Result = \"Ninety \"\n                  Case Else\n              End Select\n              Result = Result &amp; GetDigit _\n                  (Right(TensText, 1))  ' Retrieve ones place.\n          End If\n          GetTens = Result\n      End Function\n\n      '*******************************************\n      ' Converts a number from 1 to 9 into text. *\n      '*******************************************\n      Function GetDigit(Digit)\n          Select Case Val(Digit)\n              Case 1: GetDigit = \"One\"\n              Case 2: GetDigit = \"Two\"\n              Case 3: GetDigit = \"Three\"\n              Case 4: GetDigit = \"Four\"\n              Case 5: GetDigit = \"Five\"\n              Case 6: GetDigit = \"Six\"\n              Case 7: GetDigit = \"Seven\"\n              Case 8: GetDigit = \"Eight\"\n              Case 9: GetDigit = \"Nine\"\n              Case Else: GetDigit = \"\"\n          End Select\n      End Function<\/em>\n<\/code><\/pre>\n\n\n\n<iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/DREUIb7I314\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"\"><\/iframe>\n\n\n\n<p>Tags:<\/p>\n\n\n\n<h2 class=\"has-white-color has-vivid-cyan-blue-background-color has-text-color has-background wp-block-heading\">How do you create Excel add in using VBA?<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Click the File tab.<\/li><li>Click on &#8216;Save As&#8217;.<\/li><li>In the Save As dialogue box, change the &#8216;Save as&#8217; type to . xlam. <\/li><li>Open an&nbsp;<strong>Excel<\/strong>&nbsp;workbook and Go to Developer \u2013&gt;&nbsp;<strong>Add<\/strong>-ins \u2013&gt;&nbsp;<strong>Excel Add<\/strong>-ins.<\/li><li>In the&nbsp;<strong>Add<\/strong>-ins dialogue box, browse and locate the file that you saved, and click OK.<\/li><\/ol>\n\n\n\n<center>\n<object data=\"https:\/\/99excel.com\/download\/index.html\" width=\"100%\" height=\"5000\"> <\/object>\n<center>\n","protected":false},"excerpt":{"rendered":"<p>In this video, you will learn how to create and install an Excel add-ins from VBA. Simple copy and paste below code in your VBA project in any module and save it add-ins file. Tags: How do you create Excel add in using VBA? Click the File tab. Click on &#8216;Save As&#8217;. In the Save &#8230; <a title=\"Create and Install an Excel Add-in from VBA -Tutorial\" class=\"read-more\" href=\"https:\/\/99excel.com\/home\/excel-add-in\/\" aria-label=\"More on Create and Install an Excel Add-in from VBA -Tutorial\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-857","post","type-post","status-publish","format-standard","hentry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/comments?post=857"}],"version-history":[{"count":2,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/857\/revisions"}],"predecessor-version":[{"id":868,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/posts\/857\/revisions\/868"}],"wp:attachment":[{"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/media?parent=857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/categories?post=857"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/99excel.com\/home\/wp-json\/wp\/v2\/tags?post=857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}