{"id":16550287,"url":"https://github.com/sylhare/excel_vba","last_synced_at":"2026-02-21T17:01:55.773Z","repository":{"id":92385185,"uuid":"90317288","full_name":"sylhare/Excel_VBA","owner":"sylhare","description":":necktie: Some Excel macros","archived":false,"fork":false,"pushed_at":"2021-12-17T16:53:52.000Z","size":2105,"stargazers_count":36,"open_issues_count":0,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-14T20:21:57.721Z","etag":null,"topics":["excel","vba","vba-macros","vba-tips"],"latest_commit_sha":null,"homepage":"","language":"VBA","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sylhare.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-05-04T23:06:49.000Z","updated_at":"2025-01-02T04:48:04.000Z","dependencies_parsed_at":"2023-05-17T02:15:24.647Z","dependency_job_id":null,"html_url":"https://github.com/sylhare/Excel_VBA","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylhare%2FExcel_VBA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylhare%2FExcel_VBA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylhare%2FExcel_VBA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylhare%2FExcel_VBA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sylhare","download_url":"https://codeload.github.com/sylhare/Excel_VBA/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241870993,"owners_count":20034380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["excel","vba","vba-macros","vba-tips"],"created_at":"2024-10-11T19:33:45.653Z","updated_at":"2025-10-20T04:42:46.323Z","avatar_url":"https://github.com/sylhare.png","language":"VBA","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Excel VBA\n\nIn excel, you have to enable first the macro (and select the developper option). \nThen you can press \u003ckbd\u003eALT\u003c/kbd\u003e + \u003ckbd\u003eF11\u003c/kbd\u003e to go into edit macro mode. \nTo learn you can start with \"recording macro\" to see what excel is recording, but it's not the most efficient way.\n\nYou can copy / paste the files `.bas` in the `src` folder inside the macro editor (VBS) to execute them.\n\n#### Sources\n\n- Microsoft Excel 2010: [getting started](https://msdn.microsoft.com/fr-fr/library/office/ee814737(v=office.14).aspx)\n\n\n##### French Tips\n\n- [Excel plus: VBA tips](http://www.excel-plus.fr/category/vba/) \n- [Excel pratique VBA tips](https://www.excel-pratique.com/)\n- [Developpez.com outlook vba](http://dolphy35.developpez.com/article/outlook/vba/#LV-A)\n\n\n##### English Tips\n\n- [Ozgrid excel vb tutorial](http://www.ozgrid.com/Excel/free-training/ExcelVBA1/excel-vba1-index.htm)\n- [Excel easy: vba macro](http://www.excel-easy.com/vba.html)\n- [Tutorialspoint VBA](https://www.tutorialspoint.com/vba/index.htm)\n- [Rondebruin mail with outlook](http://www.rondebruin.nl/win/s1/outlook/mail.htm)\n- [Extend Office: AutoComplete](https://www.extendoffice.com/documents/excel/2401-excel-drop-down-list-autocomplete.html)\n- [Convert data type vb](http://www.convertdatatypes.com/Language-VB6-VBA.html)\n\n\n## Excel autofind drop down menu\n\nFind out the detail tutorial on how to do it here:\n\n - [How to create a dropdown search menu from an excel spreadsheet](https://sylhare.github.io/2015/02/15/Excel-autofind-dropdown-menu.html)\n\n\n## Other tips\n\nYou can find everything on my blog at:\n\n - [Excel Macro tips](https://sylhare.github.io/2015/04/17/Excel-macro-tips.html)\n\n#### Comment / Uncomment bloc of code\n\nThere's a Comment / Uncomment button that can be toggled. For that **right click** on the **menu bar** then click on **edit**, the edit tool bar will appear (you can place it in your quick access bar). There should be a **comment** and **Uncomment** **icon**. This commands will basically add or remove `'` at the beginning of every selected ligns. \n\n#### Calling a Sub\n\nHere are an example on how to call a subroutine: [here](https://msdn.microsoft.com/en-us/library/office/gg251432.aspx)\nIt can be tricky.\n```vb\nTest \"N23:Q23\", 1\nCall Test(\"N23:Q23\", 1)\n\n\nSub Test(xRange As Range, val As Integer)\n\t'some coding\nEnd Sub\n```\n\n\n#### Accelerate Macro\n\nHere are a couple of lines that can greatly improve the efficiency of your VBA macro.\n\n```vb\nSub example()\n\t'Stop automatic calculation of excel cells\n\tApplication.Calculation = xlCalculationManual\n\t'Stop screen updating\n\tApplication.ScreenUpdating = False\n\n\t'Some code\n\n\t'Put it back to \"normal\"\n\tApplication.Calculation = xlCalculationAutomatic\n\tApplication.ScreenUpdating = True\nEnd Sub\n```\n\n#### Hide \"0\" value of empty cells\n\nSometime there are some 0 that pops up with the below formulas, so here is a trick to hide them through formating.\nAvailable [here](https://support.office.com/en-us/article/Display-or-hide-zero-values-3ec7a433-46b8-4516-8085-a00e9e476b03):\n\n- Home \u003e Format \u003e Format Cells\n- Number \u003e Custom\n- type : `0;;;@`\n\n#### Userform\nSome example for the Userform\n\n```vb\nUserform\n    Textbox \n        Multiline : True\n        EnterKeyBehavior = True (sinon ctrl + Enter)\n```\n\n\n#### Closing procedure\nProcedure to close a file\n\n```vb\nSub arret()\n\t'stop the current sub\n    ActiveWorkbook.Save\n    ActiveWorkbook.Close True\nEnd Sub\n```\n\nClose the file after 10 seconds\n\n```vb\nPrivate Sub Workbook_Open()\n     temp = Now + TimeValue(« 00:00:10 »)\n     Application.OnTime temp, « arret »\nEnd Sub\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylhare%2Fexcel_vba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsylhare%2Fexcel_vba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylhare%2Fexcel_vba/lists"}