App Script Tutorial - Google Sheets - For Loops, Looping Through Cells, Variables, Comments - Part 2

Поділитися
Вставка
  • Опубліковано 29 гру 2024

КОМЕНТАРІ • 114

  • @myvsecretary1859
    @myvsecretary1859 6 років тому +6

    Its my first time writing code and your teaching was so effective I understood it conceptually before I could even do it physically. Everyone tried to show me physically but I couldn't get it because I didn't understand it conceptually.
    Once you explained App then Spreadsheet then sheet then cell, I got it instantly, and I was visualizing the same process for forms, docs, email etc. You showed me where to find the "Holy Grail" of functions, and showed me how to fit them together. Now It is now up to me to be creative and mix and match the functions that I need to do whatever and lay them out in that particular order.
    Its like learning how to walk everyone else told me to put one foot in front of the other..You brought me a skeleton, showed me how the bones and muscles worked, and with that I realized I can run walk jump, hop skip and dance.
    halfway through your video I was changing background color, string color, and trying all sort of experiments from the function list. I even wrote all the var code in one line with multiple "." to see if it worked and surprisingly it did to some degree.
    give a man fish he feeds for a day, teach a man how to fish you feed him for a lifetime.
    With this video you didn't teach me how to code, you taught me how to get what i need and how to put it together, that's not coding that's survival.
    function learnBasics(){
    var app = SpreadsheetApp;
    var ss = app.getActiveSpreadsheet();
    var sheet = ss.getActiveSheet();

    sheet.getRange("A:Z").setValue("A Big Thank You");
    sheet.getRange("A:Z").setBackground("#d7f442");
    sheet.getRange("F7:F11").setBackground("#5a6b06");
    sheet.getRange("L7:L11").setBackground("#5a6b06");
    sheet.getRange(24,6).setBackground("#5a6b06");
    sheet.getRange(25,6).setBackground("#5a6b06");
    sheet.getRange(26,7).setBackground("#5a6b06");
    sheet.getRange(27,7).setBackground("#5a6b06");
    sheet.getRange(28,8).setBackground("#5a6b06");
    sheet.getRange(29,8).setBackground("#5a6b06");
    sheet.getRange(30,9).setBackground("#5a6b06");
    sheet.getRange(31,9).setBackground("#5a6b06");
    sheet.getRange(29,10).setBackground("#5a6b06");
    sheet.getRange(28,10).setBackground("#5a6b06");
    sheet.getRange(27,11).setBackground("#5a6b06");
    sheet.getRange(26,11).setBackground("#5a6b06");
    sheet.getRange(25,12).setBackground("#5a6b06");
    sheet.getRange(24,12).setBackground("#5a6b06");

    • @sam_safari
      @sam_safari 8 місяців тому

      you are a genious

  • @khoile4477
    @khoile4477 Рік тому +1

    never thought one of the best way to learn basic Javascript was thru Google Sheets, thank you!

  • @wilsonparry9341
    @wilsonparry9341 7 років тому +3

    Ive gone thru so many of these and finally someone that can explain it. Even the google guys can't explain as well as you. Good job - ill check out the next couple

  • @bocobox
    @bocobox 4 роки тому

    I am moving back and forth your videos. now I am getting a glimpse of App script. thank you.

  • @bryangruesoo8971
    @bryangruesoo8971 4 роки тому +2

    Thanks for those videos, i was really trying to make a script for a db in sheets and after many hours searching and having errors, your explication give me an idea of how does those scripts function and i solved my problem. You saved my :)

  • @admireargumentactivity
    @admireargumentactivity 7 років тому +3

    Your first tutorial was the best tutorial I've ever seen, any genre. Good work! I hope this one is just as good.

  • @getclean2042
    @getclean2042 3 роки тому +1

    i just discovered these videos and they are SO GREAT! Thanks a lot!!

  • @MyDearFriend
    @MyDearFriend 6 місяців тому

    amazing tutorial so excited to see the whole series!!

  • @yuentl
    @yuentl 5 років тому +13

    The actual discussion of how to run a for loop starts around 11:45

    • @frankzvovu
      @frankzvovu 5 років тому

      LOL

    • @johnwaas4864
      @johnwaas4864 4 роки тому

      For the people who actually came to this video prepared lol

  • @matusalemdamarin4060
    @matusalemdamarin4060 8 місяців тому

    já assisti vários vídeos desse cara, ele explica muito bem! Material gratuito de qualidade!

  • @vishalvarshney2883
    @vishalvarshney2883 4 роки тому +2

    Excellent way of Teaching......Thank You !

  • @Hisandhermajesty
    @Hisandhermajesty Рік тому

    Best video to learn Google apps script

  • @tejaspanchal6089
    @tejaspanchal6089 4 роки тому +1

    Great! You make it so easy to understand. It is just my day 2 of learning and I am enjoying it, thanks to you.

  • @autobotgeekse
    @autobotgeekse Рік тому

    Excellent stuff. Very good way of explaining the code. Keep it up and thanks a lot for creating these videos. Wish you all the best

  • @richardazu7445
    @richardazu7445 2 роки тому

    Thanks for sharing great videos always

  • @danielafreitas7071
    @danielafreitas7071 4 роки тому +4

    Thank you!!! (from Brazil)

  • @mountainboy9044
    @mountainboy9044 3 роки тому

    You are really great !!May lord shiva bless you with everything

  • @booteesstudio7559
    @booteesstudio7559 Рік тому

    Thansks Sir for your detailed explanation.

  • @KashifZahid
    @KashifZahid 7 років тому +1

    Excellent tutorials! It has helped me a lot.

  • @21GRINDERS
    @21GRINDERS 4 роки тому

    nice! very simply for use. thanks for the video

  • @Royowski01
    @Royowski01 6 років тому

    Hi Code Teacher,
    Thanks for your good explanation about the For Loop !!

  • @jessebird8825
    @jessebird8825 3 роки тому +1

    my unimportant comment (MUC) ... 1:42 Some versions of Fortran allowed spaces in variable names.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 роки тому

      How did the interpreter know that the variable declaration was over?

  • @shouldigetit
    @shouldigetit Рік тому

    Thank you!

  • @ezequielaranda9400
    @ezequielaranda9400 7 років тому +1

    Thank you so much! This has literally saved my! THANKS!

  •  6 років тому +1

    Tremendous tutorials! :D Thanks for sharing!

  • @valentinkhoroshkov9709
    @valentinkhoroshkov9709 6 років тому

    Thank you very much, you are very good at explaining!

  • @damianslaczka5219
    @damianslaczka5219 7 років тому +1

    These are really great! Thank you!

  • @pdmadv1056
    @pdmadv1056 6 років тому

    Wonderful tutorials, thanks!

  • @emthik9615
    @emthik9615 5 років тому

    Great teaching .. thanks

  • @marcelcharest7662
    @marcelcharest7662 5 років тому +1

    Merci! (Thank you!) from Montréal

  • @eugenioremedi7380
    @eugenioremedi7380 5 років тому

    I want to learn more about loops and copying ranges to another sheet, in order to take the answers from a Google Forms form and convert them into a sheet with a list format (to use it as the base list for a pivot table). Could you help me?. Thank you for your time and sorry for such a long text!

  • @SunilKumar-ln2vr
    @SunilKumar-ln2vr 4 роки тому

    I don't get any reference when I write code like at this place 1:04 it pops up a lot of options. I also want that in my app script please help me

  • @javaejercicios4442
    @javaejercicios4442 4 роки тому

    Nice job. Most of the time, I use functional programming instead of traditional loops.

  • @commieRob
    @commieRob 7 років тому +1

    Hello! Thanks for the wonderful tutorials, I'm really enjoying them. Question: is there a way that I can define a variable in the Script Editor and then use it in Google Sheets itself? Thanks in advance.

  • @NiyazuddinMohammedHyd
    @NiyazuddinMohammedHyd 5 років тому +1

    You are awesome.!!

  • @masterhenyo7988
    @masterhenyo7988 5 років тому

    It is possible to set the variable outside and before the for loop? If is possible will it affect the speed of the code since the variable only set once unlike setting it everytime the code loops?

  • @GameOverFiles
    @GameOverFiles 3 роки тому

    How were you able to getRange() using a string and a number? Mine errors expecting me to use "A1:B2" format. It won't let me use i+8

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 роки тому

      You need to use getRange() on a worksheet object, not a spreadsheet object.

  • @HariOmJpr3715
    @HariOmJpr3715 2 роки тому

    Also give the link of the previous videos you refer to in the description.

  • @krisspinden
    @krisspinden 4 роки тому +1

    How does i++ mean that it is increasing by 1? How do you make it increase by a different amount?

  • @kerssful
    @kerssful 3 роки тому

    i love it!

  • @akankshapandey429
    @akankshapandey429 7 років тому

    Do you have any video that talks about "how to create folder in Google Drive and the folder contains n number of spreadsheets"

  • @luisforni86
    @luisforni86 3 роки тому

    Hello, how can you do a FOR loop with two columns? Ex: phone number and message

  • @vishutomar1706
    @vishutomar1706 3 роки тому

    is there a way to hide sheet tabs (only tabs and not sheet) in google sheets ?

  • @matiasaranda5850
    @matiasaranda5850 4 роки тому

    sos un crack

  • @Wemyes
    @Wemyes 6 років тому

    Why there is no saveAndClose () for sheets in app script. My sheets get modified in app script and when emailed automatically in app script , it sends the unmodified email. Help

  • @vaidiksirsate
    @vaidiksirsate Рік тому

    Great

  • @ernita1264
    @ernita1264 2 роки тому

    Hi! Question: how do you make a loop of the code and stops when it finds an empty cell?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 роки тому

      You use a while loop with an if statement, but this is not a good practice. Most of the time there is a better way to approach this.

    • @ernita1264
      @ernita1264 2 роки тому

      @@ExcelGoogleSheets can you provide me with an example for this? Let's say if a column has an empty cell, it stops the program/loop

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 роки тому

      var ss = SpreadsheetApp.getActive();
      var sheet = ss.getActiveSheet();
      var cell = ss.getCurrentCell();
      var cellValue = cell.getValue();
      while (cellValue != "") {
      cell = cell.offset(1, 0);
      cellValue = cell.getValue();
      }

    • @sam_safari
      @sam_safari 8 місяців тому

      @@ExcelGoogleSheets very helpfull

  • @tazulislam2698
    @tazulislam2698 5 років тому

    Bro! which version are you using?

  • @DocPosture
    @DocPosture 6 років тому

    2 words... awesomesauce

  • @mrsmoove808
    @mrsmoove808 5 років тому

    smooth coding

  • @montecristobal
    @montecristobal 7 років тому

    Hi! thanks for sharing. What about using "let" or "const" instead of "var" to declare variables? I am doing a course in Codeacademy and they are not using "var" anymore.
    Thank you.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  7 років тому +1

      As far as I know Apps Script doesn't support ES6 at this point, so you'll need to stick with var for now.

    • @sam_safari
      @sam_safari 8 місяців тому

      @@ExcelGoogleSheets interesting explanation

  • @pathakullahrabiya7397
    @pathakullahrabiya7397 3 роки тому

    Can make user form in google sheet like as excel vba?

  • @siddharthjain6629
    @siddharthjain6629 4 роки тому

    Sir i have difficulty in running for loop i understood the concept of for loop but it is not working and taking lot of time to load can ypu help me on that

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому

      ua-cam.com/video/985XJOeigpA/v-deo.html

    • @siddharthjain6629
      @siddharthjain6629 4 роки тому

      @@ExcelGoogleSheets sir i have watched this video of arrays of arrays and it is very much help ful when we are dealing with large no data but i am trying for lop for very small data range then also its not working 😢😢

    • @siddharthjain6629
      @siddharthjain6629 4 роки тому

      And it is easy but i dont why its not working at first i tried by myself i didnt work then i did step by step as per your video then also not working

    • @sam_safari
      @sam_safari 8 місяців тому

      @@siddharthjain6629 u gotta uptade the version of you script

  • @hecatoplex5506
    @hecatoplex5506 5 років тому

    How do you loop through an array of OverGridImages?

  • @cary6652
    @cary6652 3 роки тому

    I have no idea how this is working, but I got it working with this.
    for(var i=1;i

    • @sam_safari
      @sam_safari 8 місяців тому

      what's your point

  • @TheJPZone
    @TheJPZone 4 роки тому

    Could you please assist.. A code to get a active cell after A1 and till last active cell.. Which means range that should be the active cell which is next to A1 and. Active();
    Please help

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 роки тому +1

      get last row and last column from the active cell and use them inside getRange(1,1,lr,lc)

  • @singhalmonica
    @singhalmonica 4 роки тому

    Pls help me to use vlookup fn. By script, dynamically.

  • @climbeverest
    @climbeverest 5 років тому

    Nice

  • @PaulSmithVPS
    @PaulSmithVPS 6 років тому

    My R1C1 references don't seem to work like in the video. I can only use A1. Anybody know why?

  • @PeterAndrews-c5h
    @PeterAndrews-c5h Рік тому

    Sir can you help with google sheet scripts

  • @nayltonlopes8688
    @nayltonlopes8688 5 років тому +1

    Hi Everyone, How can I apply a "breakpage" on spreadsheet using Google Script?
    Thank you all!

    • @sam_safari
      @sam_safari 8 місяців тому

      you are ready know

  • @NamHaVblog
    @NamHaVblog 4 роки тому

    thanks

  • @matthieu9948
    @matthieu9948 4 роки тому

    great

  • @CreemosEnJesucristo
    @CreemosEnJesucristo 6 років тому

    Excelente video ... cómo puedo filtrar una hoja en google sheet ? cuál sería el código o script ? God Bless You.

  • @sam_safari
    @sam_safari 9 місяців тому

    you are ready know

  • @phoenixempire8886
    @phoenixempire8886 4 роки тому

    🙏🏻

  • @dangkhanhlinh476
    @dangkhanhlinh476 5 років тому +1

    the name part 2 let move at the Begin of video name.

  • @trueordrue
    @trueordrue 2 роки тому

    16:33

  • @emilolorunadeolujoshua1788
    @emilolorunadeolujoshua1788 4 роки тому

    please sir if you can always shear the link to your earlier lesson(I mean part one
    ) on descriptions so that we can browse them faster. thanks so much

    • @sam_safari
      @sam_safari 8 місяців тому

      look on the playlist

  • @charlesmurray322
    @charlesmurray322 6 років тому

    Has anyone found part 1 of this tutorial ?

  • @shabnambibi2380
    @shabnambibi2380 3 роки тому

    please help me

  • @thebrucecyou
    @thebrucecyou 5 років тому +1

    Half of the video is the same stuff as the last video

    • @sam_safari
      @sam_safari 8 місяців тому

      u gotta be sure of your words but they are very different

  • @sauau9588
    @sauau9588 3 роки тому +1

    great

  • @rishirishi4970
    @rishirishi4970 2 роки тому

    Thanks