+ Reply to Thread
Results 1 to 9 of 9

Converting macro from Excel to Google Docs

  1. #1
    Registered User
    Join Date
    07-25-2017
    Location
    Latvia
    MS-Off Ver
    MS Office 2010
    Posts
    91

    Converting macro from Excel to Google Docs

    Good morning, evening or afternoon!

    I have an Google Docs spreadsheet with many sheets.

    I need one summary sheet, where column A data from each sheet appears next to each other. I found the VBA and modified for my needs here:
    https://www.mrexcel.com/board/thread...y-side.718664/

    It works perfectly for downloaded excel file. However I need it for Google Docs spreadsheet. Can you please advise how the code should be changed so that it does the same actions?

    Please Login or Register  to view this content.
    Cheers!

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Converting macro from Excel to Google Docs

    Google Docs uses a language called Google Application Script which is basically JavaScript.

    You would need to rewrite the entire above code to work in Google Spreadsheet because VBA is not compatible.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    07-25-2017
    Location
    Latvia
    MS-Off Ver
    MS Office 2010
    Posts
    91

    Re: Converting macro from Excel to Google Docs

    Okay...
    Can anyone help me with this code? The idea stays the same. I would need to copy col A & B from each sheet to new sheet, so that data from each sheet is next to each other.

  4. #4
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,133

    Re: Converting macro from Excel to Google Docs

    See the attached text file which includes the script to retrieve all Column A data in all tabs and importing into the tab "MergedSheet"

    Note: I couldn't post the script here because of the firewall of the forum, that's why i've attached the text file.
    Attached Files Attached Files
    Last edited by Haluk; 10-14-2021 at 05:47 AM.

  5. #5
    Registered User
    Join Date
    07-25-2017
    Location
    Latvia
    MS-Off Ver
    MS Office 2010
    Posts
    91

    Re: Converting macro from Excel to Google Docs

    Awesome, thanks!

    Quick question - if I have to delete another sheet before running macro (lets call it "Sheet_0"), what should I do? I tried this way, but it shows errors
    Please Login or Register  to view this content.
    Last edited by robert26; 10-15-2021 at 03:25 AM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,354

    Re: Converting macro from Excel to Google Docs

    Administrative Note:

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

    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.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,133

    Re: Converting macro from Excel to Google Docs

    As the moderation request has been fulfilled;

    @robert26, try this;

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-25-2017
    Location
    Latvia
    MS-Off Ver
    MS Office 2010
    Posts
    91

    Re: Converting macro from Excel to Google Docs

    Awesome, works as it should
    So | works as OR for Google Docs scripts?

  9. #9
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,133

    Re: Converting macro from Excel to Google Docs

    Yes, it does ...

+ 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. I can't use this VBA Macro on Google Docs or Excel Online
    By kevb8ll in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2018, 06:59 PM
  2. [SOLVED] Excel to google docs
    By SPIG in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 6
    Last Post: 05-02-2017, 03:42 AM
  3. converting excel macro into a google docs script??
    By scottatbuckman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2016, 12:47 PM
  4. How to enable Macro in Google Docs
    By jasond1992 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2015, 11:33 PM
  5. pull certain data from google docs form-produced spreadsheet to other docs
    By MisterCadillac in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 03-11-2014, 04:49 AM
  6. Converting spreadsheets from Microsoft Excel to Google Docs
    By hammerb in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 10-08-2013, 02:32 PM
  7. [SOLVED] converting excel docs to word docs
    By rolercster in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-04-2005, 04:06 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