Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Moving Data Google Sheets

  1. #1
    Junior Member
    Join Date
    Nov 2022
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Moving Data Google Sheets

    Looking to move data from one spread sheet to a seperate spreadsheet in Google Docs using a checkbox.

    The following code that I have got working as far as moving that data from one doc to the other with the checkbox. I'm stuck with getting it to move from a certain cell in the first sheet to the exact same cell in the second sheet.

    Thanks in advance for any help.


    function moveRowOnCheck(e) {
    const src = e.source.getActiveSheet();
    const r = e.range;
    if (src.getName() != 'Sheet1' || r.columnStart != 3 || r.rowStart == 1 || e.value != 'TRUE') return;


    const ui = SpreadsheetApp.getUi();
    const res = ui.alert("Move row?", ui.ButtonSet.YES_NO);

    if (res == ui.Button.NO) {
    r.uncheck();
    return;
    }

    const dest = SpreadsheetApp.openById("SheetID").getSheets()[0];
    //src.getRange(r.rowStart, 1, 1, 3).moveTo(dest.getRange(dest.getLastRow() + 1, 1, 1, 3));
    dest.getRange(dest.getLastRow()+1,1,1,3).setValues (r.offset(0,-2,1,3).getValues());
    src.deleteRow(r.rowStart);

    }

  2. #2
    Junior Member AlexKabar's Avatar
    Join Date
    Jul 2023
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Moving Data Google Sheets

    I totally get where you're coming from with wanting to move data between Google Sheets using checkboxes. It's a handy way to automate tasks and keep things organized.

  3. #3
    Junior Member
    Join Date
    Jun 2022
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Moving Data Google Sheets

    When I was working on a similar project, I needed to transfer data from one sheet to another when a checkbox was ticked. I started with some code but ran into a small hiccup regarding the exact cell placement in the second sheet.
    After a bit of trial and error, I realized that to make it work seamlessly, I had to specify the exact coordinates of the destination cell in the second sheet within the setValues function. This way, the data would end up exactly where I wanted it, mirroring the original sheet.
    It might take a bit of tweaking and testing, but trust me, once you get it right, it's incredibly satisfying to see your checkboxes automating the data transfer flawlessly.
    If you ever need help with data management or other tech-related issues, you can check out https://datahive360.com/ for some useful solutions.
    Last edited by YoselinMatthews; January 31st, 2024 at 09:14 AM.

  4. #4
    Member Helium c2's Avatar
    Join Date
    Nov 2023
    Location
    Kekaha, Kaua'i
    Posts
    102
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Moving Data Google Sheets

    Just get a free web host. Add a box from there. Reload it from your pc. Add the buttons from home. http://localhost8080/ then whatever you named it here. This will work. Java and encapsulation. The members are privately declared. But made public for others to view or download from. That's the idea behind it. C++ and also Java.
    Last edited by Helium c2; January 25th, 2024 at 04:29 PM.

Similar Threads

  1. Google Drive, Google spreadsheet Manipulation App
    By tsurubaso in forum Member Introductions
    Replies: 0
    Last Post: November 24th, 2019, 12:22 AM
  2. Replies: 4
    Last Post: May 7th, 2014, 11:01 AM
  3. adb shell - installing or moving apk from /data to /mnt/sdcard
    By verbose in forum Android Development
    Replies: 0
    Last Post: May 21st, 2013, 12:45 PM
  4. program won't compile, can't get data from google analytics
    By nervous in forum What's Wrong With My Code?
    Replies: 3
    Last Post: June 20th, 2012, 11:57 PM
  5. 64 Java Cheat Sheets(Ref cards)
    By saggammahesh in forum Java Programming Tutorials
    Replies: 2
    Last Post: May 1st, 2012, 07:42 AM