Write a macro to create a new tab and name that tab based on a cell value in Google Sheets

I would like to have a Macro that generates a new tab and name that tab based on a cell value.

There is a tab called 'Dashboard'! in which the user enters information in the assigned cells. Next, I would like there to be a button on which the user clicks, on which the information on the 'Dashboard'! it is copied to a new leaf. That new sheet must receive the name that the user has entered in the cell B2 (the name of the day) and cell phone C2 (the date of that day), followed by the word "Training".

I have successfully recorded a Macro that does most of this, but naming the new tab based on a cell value seems impossible. I have manually changed the name of the tab, which is perfectly displayed in the Macro. However, I don't know how to make this name. & # 39; dynamic & # 39;.

Thanks in advance for any help, sorry in advance if this question is redundant and / or is improperly worded.

Why does Google Sheets change the color of some cells alone?

I created a new sheet and tried some formulas and some of the cells have some kind of yellow color:

enter the description of the image here

I did not change any of the colors of the cells. Does this color indicate anything? Sometimes, the chain cells are also of this color and I don't understand why it is happening.

Filter the row that contains an exact word and the highest value in Google Sheets

I have a table (master sheet) in Google Sheets that looks like this:

enter the description of the image here

I need to filter a whole row of information on a separate sheet (Last Lesson) but only related to someone's last lesson, for example. Sam and his third lesson. I tried adding several different things to my filter option, but without success. My knowledge of Excel / Google Sheets is basic, so if there is another way to do it without the filter option, share.

Button that runs through a list of values ​​in Google Sheets

I want to see what the different headlines look like within a Google ad, so I’ve set up an ad template on one tab and a list of headlines on another.

Then I want a button on the template that can scroll through the list of values ​​to see how the different headlines look. I will also do this to see different descriptions with a separate button and list. How can I do this?

Google Sheets: Summerize the data in a pivot table, but exclude certain data if it is as a certain value in a given column

I have some data in a Google Drive spreadsheet where I want to run a pivot table, there are 3 columns Element, Cost, Omit according to the screenshot below

screenshot of spreadsheet columns

I want to summarize the cost per item, but exclude any line that has the value "skip" in the "skip" column

I have started to set up the pivot table, to summarize the cost per item that works well, but I can't figure out how to exclude the "skip" items in the pivot table summary.

To help, I created a shared Google spreadsheet here, go to File > make a copy if you want to use it Link to the Google Drive spreadsheet: https://docs.google.com/spreadsheets/d/1gvsg8shqWJnK_zRxQUFcWDwJxE1ym6lSE35fSAqpx8s/edit#gid=0

You need unique values ​​from a range in google sheets

I need to list unique values ​​of 12 columns in columns of a different sheet.

Like sheet 1 it has a column.

I need to list the unique values ​​of the 12 columns on sheet 2 to column Sheet1 A.

I like it;

enter the description of the image here

I want to list like this:

I want to make a list like this

Thank you

Google applications script: sync cell changes in sheets

I am trying to connect a couple of cells on different sheets within the same Google spreadsheet, so that after entering a new value in one cell, the other cell will be updated to match that value, going in both directions . I found this old question and answer that seems to offer a solution in this script:

function sync(e) {
  var sheetName = ('Sheet1', 'Sheet2', 'Sheet3', 'Sheet4');  // name of sheets
  var cell = ('A1', 'B2', 'B1', 'A1');    // corresponding cells to sync
  var r = e.range;
  var ss = e.source;
  var value = (e.value === undefined ? '' : e.value);
  var i = sheetName.indexOf(r.getSheet().getSheetName()); 
  if (i > -1 && r.getA1Notation() == cell(i)) {
    for (var k = 0; k < sheetName.length; k++) {
      if (k != i) {

However, I can't make it work in my spreadsheet. I have put the names of the sheets and cells that I want to make reference in the matrices, but when I try to execute it, it gives me the following error:

TypeError: Cannot read property "range" from undefined. (line 4)

That seems a pretty clear indication that I am supposed to define range property in some way, but my level of experience in scripting is best described as "cult of the load," and the author of the original question seemed satisfied with the script as originally given, so & # 39; m lost.

google sheets: fill formula to the last row used

This function is to copy a formula C2424 to the last row used. Instead of copying it to the last formula used, it copies it to the last row within the sheet. How can I do it only in the last row that is being used?

function copiarformulas() {

var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var lr = ss.getLastRow();

var fillDownRange = ss.getRange(2424, 3, lr); 


TEST SHEET to reproduce the problem:


google sheets – Add column checkbox format using AppScript

Trying to add the check box format to a column using AppScript to this working formula

    var fillDownRange = sales.getRange (2, 9, salesLR);

I tried to do it this way without success:

var fillDownRange = sales.getRange (2, 9, salesLR);

I also tried this without success:

      var fillDownRange = sales.getRange (2, 9, salesLR);

How to make a mini-graphic in bold in Google Sheets?

Yes, it is parameter linewidth.
Example: =SPARKLINE(L4:L;{"linewidth"3})

Reminder on how to build a =sparkline :


More about sparkline here.