+ Reply to Thread
Results 1 to 6 of 6

Auto-populate a cell with a date today [Google Apps Script]

  1. #1
    Registered User
    Join Date
    09-14-2015
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    15

    Auto-populate a cell with a date today [Google Apps Script]

    Hi all!

    Sending the edited version, i hope i get it right. Thank you!

    Its been a while since I posted here. Thank you in advance to all.

    I am using Google Sheet for this code and I tried this code for auto-populate a cell with the a date if the adjacent cell is filled with a text. But it says this "Missing; before statement. (line 3, file "Code")"

    Here is my code.

    Please Login or Register  to view this content.
    Last edited by Kotasyon; 09-26-2019 at 12:55 AM. Reason: Correction of code

  2. #2
    Forum Moderator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    365
    Posts
    16,906

    Re: Auto-populate a cell with a date today

    I am moving your thread since this is about Google Sheets and Google Apps macros.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    When adding code tags, replace your "*" characters with spaces.

    Please take a moment to add the tags. Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2016 primarily
    Posts
    5,195

    Re: Auto-populate a cell with a date today [Google Apps Script]

    I don't know much about Google Apps scripts, but I can tell you two things:
    1. You can't just stick Excel VBA inside a script function declaration; and
    2. The function you want is most likely:
    Please Login or Register  to view this content.
    See here: https://developers.google.com/apps-s...riggers/events
    Rory
    I drink, and I know things

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,687

    Re: Auto-populate a cell with a date today [Google Apps Script]

    As Rory stated, you can't use VBA within Google Script. It should be written in App Script (variant of Java script).

    For what you are after, read link below. It details step by step, how to implement the script (turning on project) along with how it can be used.
    https://yagisanatode.com/2018/02/21/...google-sheets/
    “Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.”
    ― Robert A. Heinlein

  5. #5
    Registered User
    Join Date
    09-14-2015
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    15

    Re: Auto-populate a cell with a date today

    Good Day!

    I have edited my post for more readable content.

    Thank you!

  6. #6
    Registered User
    Join Date
    09-14-2015
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    15

    Re: Auto-populate a cell with a date today [Google Apps Script]

    Hi! Thank you for your help and used this code, but I had encountered a problem. When I am copying data from a Sheet1 and pasting to the Coded Sheet, only the first data in A1 has a Date.
    Ex: Copy from Sheet1 B1:B5: and paste it to Coded Sheet B1:B5..The only appears in A1. Thank you for your help again.

+ 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. Auto suggest today date in a cell
    By emina002 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-03-2017, 11:02 AM
  2. Auto Populate today date in cells
    By alipezu in forum Excel General
    Replies: 2
    Last Post: 11-20-2016, 06:34 AM
  3. Replies: 4
    Last Post: 06-19-2016, 09:39 PM
  4. [SOLVED] Auto Fill Cell With Today's Date And Shift Cells To The Right
    By EricBarnes88 in forum Excel General
    Replies: 9
    Last Post: 02-06-2014, 09:26 AM
  5. [SOLVED] help!! Need Sheet2 to auto populate with dates that are today's date or 90 days out
    By JennK in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-30-2012, 07:33 PM
  6. Click on a blank cell to auto add today's date
    By DK1981 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-10-2011, 05:55 AM
  7. Auto-populate Today's Date?
    By Ocean Zhang in forum Excel General
    Replies: 1
    Last Post: 03-12-2011, 11:23 AM

Tags for this Thread

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