Skip to content

Instantly share code, notes, and snippets.

ndthanh /
Created Sep 28, 2020 — forked from brucemcpherson/
Google Apps Script equivalents for common VBA function
/** @description
* javaScript/Google Apps script functions that are equivalent to common VBA functions
* in general these provide the same functionality and have the same calling stack
* See for more details
* @author <a href="">Bruce McPherson</a><a href=""></a>
* Removes leading and trailing whitespace
* @param {string|number} v the item to be trimmed
View extract_numbers.txt
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Mix", type text}}),
#"Added Custom" = Table.AddColumn(
#"Changed Type",
each Text.Combine(List.RemoveNulls(List.Transform(Text.ToList([Name]),
each if Value.Is(Value.FromText(_), type number) then _ else null))))
#"Added Custom"
View onEdit_add_time.js
function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() == "Sheet1" ) { // Thay tên sheet tương ứng
var r = s.getActiveCell();
if( r.getColumn() == 1 ) { // kiểm tra cột đang nhập dữ liệu phải cột thứ 1 hay không
var nextCell = r.offset(0, 1); // dùng offset để ghi thời gian sang cột bên phải
if( nextCell.getValue() === '' ) // kiểm tra xem ô kế tiếp có rỗng không
nextCell.setValue(new Date());
* Unpivots the given data
* More:
* @return Unpivoted data from array
* @param {object[][]} arr 2D Input Array
* @param {object[][]=} headers [optional] Custom headers for output
* @customfunction
function unpivot(arr, headers) {
# Python List
fruits = ["tao", "chuoi", "cam", "mit", "dua hau", "kiwi", "ca chua"]
# print(type(fruits))
# Access item in list, access first item by index, start from 0
# print(fruits[0])
# print(fruits[1])
# print(fruits[2])
# print(fruits[len(fruits)-1])
ImportJSON by Brad Jasper and Trevor Lohrbeer
Version: 1.5.0
Project Page:
Copyright: (c) 2017-2019 by Brad Jasper
(c) 2012-2017 by Trevor Lohrbeer
License: GNU General Public License, version 3 (GPL-3.0)
* Imports JSON data to your spreadsheet Ex: IMPORTJSON("","city/population")
* @param url URL of your JSON data as string
* @param xpath simplified xpath as string
* @customfunction
function IMPORTJSON(url,xpath){
// /rates/EUR
View one_formula_calendar_short.txt
Thiết lập:
AN1="SUN" hoặc "MON"
Tác giả: T.D.Nguyen
Rút gọn: N.D.Thanh
View listview_extended.bas
Option Explicit
Private Sub TextBox1_Change()
Dim rng As Range
Dim q As String
q = LCase(TextBox1.Text)
Dim c As Long
Set rng = Range("rngDaten")
Dim strToSearch As String, i As Long
Dim lRow As Long, lCol As Long
With Me.ListView1
View ComponentsScreen.js
import { StyleSheet, Button } from 'react-native';
import React, { Component } from 'react';
import { Platform, View, Text } from 'react-native';
import { BleManager } from 'react-native-ble-plx';
export default class ComponentsScreen extends Component {
constructor() {
this.manager = new BleManager();