An open API service indexing awesome lists of open source software.

https://github.com/Rotifer/VBA_GAS_UDFs

General utility functions for Excel and Google Sheets
https://github.com/Rotifer/VBA_GAS_UDFs

Last synced: 4 months ago
JSON representation

General utility functions for Excel and Google Sheets

Awesome Lists containing this project

README

        

README

h1 {font-size: 34px;}
h1.title {font-size: 38px;}
h2 {font-size: 30px;}
h3 {font-size: 24px;}
h4 {font-size: 18px;}
h5 {font-size: 16px;}
h6 {font-size: 12px;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }

code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}

code{white-space: pre;}

if (window.hljs) {
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
if (document.readyState && document.readyState === "complete") {
window.setTimeout(function() { hljs.initHighlighting(); }, 0);
}
}

.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
details > summary > p:only-child {
display: inline;
}
pre code {
padding: 0;
}

.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}

.tabset-dropdown > .nav-tabs > li.active:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}

.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "";
border: none;
}

.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}

.tabset-dropdown > .nav-tabs > li.active {
display: block;
}

.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
background-color: transparent;
}

.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}

.tabset-dropdown > .nav-tabs > li {
display: none;
}


VBA_GAS_UDFs



Summary


General utility functions for Excel and Google Sheets written in in VBA and GAS. These are generally call as user-defined or custom functions. The Excel VBA functions are generally stored in Personal.xlsb and are thereby available to all Excel files. Google Sheets does not have such a mechanism for sharing such functions so they have to be copied into the GAS editor of any Sheets documents where they are to be used.




Contents guide



VBA


There are descriptions of each of the functions in the file GeneralFunctions.bas.



Function: URL


Summary:Extracts the URL from cell hyperlinks, returns an empty string if the input cell is not a hyperlink.


Usage: Provides a convenient way to get the URL from cells with hyperlinks which is slightly painful from to do from the Excel interface.




Function: DATE_AS_ISO8601_STRING


Summary: Returns the date of a cell as an ISO8601-formatted string or an empty string if the input cell is not of type date.


Usage: Excel (and Sheets for that matter) requires caution when working with dates. Cell values can be automatically converted to dates and this can lead to data corruption. Also, dates are presented differently in different locales; for example, is the date 2/1/2001 the second of January 2001 or the first of February 2001? It depends on the locale; in the UK the date would be interpreted as the former but as the latter in the US. This function can be used to convert a date to a recognised international standard: ISO8601. Furthermore, it stored the date as a string which serves to protect it from further Excel re-interpretation and stores it as a value that is easily interpreted by other storage mechanisms such as relational databases or when serialised as a JSON string.





// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.odd').parent('tbody').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});

$(document).ready(function () {
window.buildTabsets("TOC");
});

$(document).ready(function () {
$('.tabset-dropdown > .nav-tabs > li').click(function () {
$(this).parent().toggleClass('nav-tabs-open');
});
});

(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();