+ Reply to Thread
Results 1 to 4 of 4

Looping code to run continuously in (Excel) Google sheets

  1. #1
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Looping code to run continuously in (Excel) Google sheets

    Hi,

    I have a Looping code that will perform an action every 10 seconds.

    Please Login or Register  to view this content.
    I want to add this to a Googlesheet and I'm concerned about running a Macro that will run continuously, perhaps adding a processing load to the PC.

    Maybe there's a better way to do this?

    There may be other methods and the only thing that must be used is Googlesheets.

    Thanks.
    Last edited by noboffinme; 12-05-2022 at 03:22 AM.
    Remember you are unique, like everyone else

  2. #2
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Looping code to run continuously in (Excel) Google sheets

    To clarify, apps scripts run on the server, not in your computer: https://developers.google.com/apps-script/overview

    Moving on, the script appears to be making a popup then running a procedure (function) every 10 seconds, is that right?

    If so, a few things you should be aware of:
    * simple trigger apps scripts must complete within 30 seconds
    * installable trigger apps scripts must complete within 6 minutes
    * installable triggers can not be run in shorter timeframe than 1 minute intervals
    * if you abuse the quotas then your apps scripts may be restricted
    As a gesture off appreciation, you can click * Add Reputation at the foot of any of the posts of members who helped you reach a solution.

    And finally, was your problem solved? if so, please click Thread Tools above the first post of your enquiry, then select [Solved]

  3. #3
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: Looping code to run continuously in (Excel) Google sheets

    Thanks janmorris,

    Yes this example is a quick example to prove the repetition loop will work by showing a Popup & running the Function.

    What I will add is the functionality run when new data is populated to a certain worksheet.

    It would then distribute the values to a worksheet depending in it's value type.

    It looks like I can add this code to a Google sheet and run it to suit the parameters you have described.

    Re my question about having a macro running constantly, maybe a trigger is a better idea.

    Thanks for your comments.

  4. #4
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Looping code to run continuously in (Excel) Google sheets

    "macro running constantly, maybe a trigger is a better idea"

    The way Apps Scripts work is ALWAYS from a trigger of some kind, they never "run constantly".

    See:
    https://developers.google.com/apps-s...uides/triggers
    https://developers.google.com/apps-s...rs/installable

    To have the effect of running constantly will require an apps script to stop after running for N minutes (where N is anything less than or equal to 6 minutes) and to be retriggered at any time greater than the time it was halted.

    NOTE: Technically speaking, macros are apps scripts that run based on keystrokes. All macros are apps scripts, but not all apps scripts are macros, if that makes sense.
    https://developers.google.com/apps-s.../sheets/macros

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Google Sheets. Can I connect offline data from excel to google sheets?
    By drlemur39 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 11-15-2021, 10:40 AM
  2. (Google App Scripts) Copy and paste value for all Google Sheets contained in one folder
    By bobbiekan in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 09-29-2021, 11:48 PM
  3. Google sheets copy paste
    By WAAZUPEE in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 01-14-2019, 03:33 PM
  4. Google Apps Script for Google Sheets Pulling Formulas from Master to Several Slave Sheets
    By excelroofing in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 08-22-2018, 02:06 AM
  5. Excel Paste Data to Specific Cell in Google Sheets
    By alexnkc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2017, 01:08 PM
  6. [SOLVED] Looping Macro to cut rows based on value and paste them into new sheets
    By Ethanrholt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-17-2014, 08:59 AM
  7. Looping Through Some Sheets to Sort Copy & Paste
    By luke1438 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2010, 12:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1