How to use cDataSet.bigCommit() to create a copy of the values in a sheet, and filter the resultsIn Make a copy of a worksheet we looked at how to use the .bigCommit() method of
cDataSet to copy a table from one worksheet to another. This method is also capable of filtering - meaning only copying rows where a particular column value equals some value. Here's
how to copy only rows where the city is London. Public Sub straightCopyFilter() Dim ds As New cDataSet ds.populateData(wholeSheet("geoCoding")).bigCommit _ wholeSheet("messAround"), True, , "city", "London" End Sub Google Apps Script In this example, I am going to assume now that you are using cDataSet from an external library rather than from a local copy. You will see that we are using the functions from the Mcpher namespace. function ds() { new Mcpher .cDataSet() .populateData(Mcpher.wholeSheet("Test")) .bigCommit(Mcpher.wholeSheet("messAround"),true,undefined,"city","London"); } You want to learn Google Apps Script?Learning Apps Script, (and transitioning from VBA) are covered comprehensively in my my book, Going Gas - from VBA to Apps script, available All formats are available now from O'Reilly,Amazon and all good bookshops. You can also read a preview on O'Reilly. If you prefer Video style learning I also have two courses available. also published by O'Reilly. |
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Get Started Snippets >