+ Reply to Thread
Results 1 to 7 of 7

Delete blank cells in google sheets

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

    Delete blank cells in google sheets

    Hey!

    This would be a part of larger macro, but I am struggling with one step. I have Google Docs spreadsheet with ~400 columns.
    The structure is similar to attached example - all columns have Row A filled, but for the rest of the table there could be 1 or multiple empty cells each row before additional data appears. I want to remove those spaces.

    For MS Excel I would just use Find > Go to special > Blanks > Delete.

    However no such option exists in Google docs

    Does anyone have any brilliant ideas?

    Sheet 1 - starting data
    Sheet 2 - the result I want
    Attached Files Attached Files
    Last edited by robert26; 10-20-2021 at 02:17 AM.

  2. #2
    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,150

    Re: Delete blank cells in google sheets

    You can run the function "main" to delete blank cells in columns A ~ F

    Change the sheet name "Sheet1" if its different in your original Google Sheet.

    Please Login or Register  to view this content.

  3. #3
    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,150

    Re: Delete blank cells in google sheets

    You may need a loop in thr function "main" for 400 columns.
    But i am away from my computer now....

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

    Re: Delete blank cells in google sheets

    Thanks! Can you please show how looping would look like for that part? Im quite new to this.

  5. #5
    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,150

    Re: Delete blank cells in google sheets

    Delete the previous functions and use these;

    Note: Change 10 to 400 or whatever your count of columns is....

    Please Login or Register  to view this content.
    Last edited by Haluk; 10-28-2021 at 02:36 AM.

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

    Re: Delete blank cells in google sheets

    Thanks. it works, but for i <=2000 script runs for 20 min. Is that normal? at the moment table is like 300x500 cells filled with some blanks inbetween.

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

    Re: Delete blank cells in google sheets

    because the cleanup is done by one column after the other, cleaning one column is not the same as cleaning thousands.

+ 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. [SOLVED] Google Sheets:Formula for Duplicate Entries over multiple rows and ignoring blank columns.
    By ItsRay in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 9
    Last Post: 10-18-2021, 10:59 AM
  2. Google Sheets - I need help in highlighting cells and getting sum of highlighted cells
    By eyah002 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 12-19-2020, 08:48 AM
  3. 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
  4. Replies: 12
    Last Post: 05-29-2018, 05:11 PM
  5. Google Sheets - How to create graph from cells referencing other cells sorted/filtered dif
    By ergalthema in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 03-05-2018, 02:35 PM
  6. Replies: 0
    Last Post: 03-05-2018, 02:35 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